Changes between Version 1 and Version 2 of Ticket #18542, comment 13


Ignore:
Timestamp:
2020-01-21T03:35:25+01:00 (6 years ago)
Author:
nyurik

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18542, comment 13

    v1 v2  
    22
    33If the goal is to get the right value->URL formatter in tag2link, the easiest is to follow the same scheme as what iD does (see [https://github.com/openstreetmap/iD/blob/189a3f87e389f9c2745a9c25b98ec0e4823776dc/modules/services/osm_wikibase.js#L183 code]). Steps:
    4 1. convert key to a "sitelink":   `("Key:" + key).replace('_', ' ')`
     41. convert key to a "sitelink":   `("Key:" + key).replace('_', ' ')` (replace underscores with spaces)
    551. call `www.osm.org/w/api.php?action=wbgetentities&...` to get the data items for each of the sitelinks. You should pass all sitelinks to it in a single call, rather than calling it multiple times. See above code link.
    661. check if [https://wiki.openstreetmap.org/wiki/Property:P8 P8 property] claim is defined on each of the resulting data items, and if so, use it.