Changeset 33288 in osm for applications/editors/josm/plugins/wikipedia
- Timestamp:
- 2017-05-03T10:21:59+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java
r33098 r33288 46 46 private static final XPath X_PATH = XPath.getInstance(); 47 47 private final String wikipediaLang; 48 private final String siteId; 48 49 49 50 private WikipediaApp(final String wikipediaLang) { 51 52 // FIXME: the proper way to get any wiki's site id is through an API call: 53 // https://zh-yue.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=general 54 // use "wikiid" value. The value may be cached as it will never change 55 String siteId = wikipediaLang.replace('-', '_'); 56 switch (siteId) { 57 case "be_tarask": 58 siteId = "be_x_old"; 59 break; 60 } 61 50 62 this.wikipediaLang = wikipediaLang; 63 this.siteId = siteId + "wiki"; 51 64 } 52 65 … … 263 276 "?action=wbgetentities" + 264 277 "&props=sitelinks" + 265 "&sites=" + wikipediaLang + "wiki"+266 "&sitefilter=" + wikipediaLang + "wiki"+278 "&sites=" + siteId + 279 "&sitefilter=" + siteId + 267 280 "&format=xml" + 268 281 "&titles=" + articles.stream().map(Utils::encodeUrl).collect(Collectors.joining("|"));
Note:
See TracChangeset
for help on using the changeset viewer.