Hi.

You're right, I didn't think about it. So to have all result, I have to call all API on each Wikivoyage version ?

Thank you.

Le 22/07/2015 17:51, Petr Kadlec a écrit :
Hi,

On Wed, Jul 22, 2015 at 5:10 PM, Sylvain Arnouts <sylvain.arno...@wanadoo.fr
wrote:
Actually, it's the same for other languages, but the API has a very
specific way to manage languages in request.

To have the datas in different languages, we have to call the langlinks
props in the url, and then do llprop=url to have the url of the page for
each languages. This is the final request I send to the API :
                 $wikivoyageRequest = "
https://en.wikivoyage.org/w/api.php?action=query&format=json&"; //Base
."prop=coordinates|info|langlinks&"    //Props list
                                     ."inprop=url" //Properties dedicated
to url
                                     ."&llprop=url"//Properties dedicated
to langlinks
."&generator=geosearch&ggscoord=$user_latitude|$user_longitude&ggsradius=10000&ggslimit=50";
//Properties dedicated to geosearch

The answer contains every link for every language, so I guess it solves my
problem.

Well, that depends on what exactly is your problem. The query you have
shown here is "find all articles within the radius on the English
Wikivoyage, and give me the versions of those English articles in other
languages, if they exist". However, if you try e.g. <
https://en.wikivoyage.org/w/api.php?action=query&prop=coordinates|info&inprop=url&generator=geosearch&ggscoord=46.016667|-1.175&ggsradius=10000&ggslimit=50&ggsradius=10000&ggslimit=50>,
you'll find nothing, even though there is an article about Île d'Aix (lying
on those coordinates) on the French and German Wikivoyages, which you
_will_ find using <
https://de.wikivoyage.org/w/api.php?action=query&prop=coordinates|info&inprop=url&generator=geosearch&ggscoord=46.016667|-1.175&ggsradius=10000&ggslimit=50&ggsradius=10000&ggslimit=50>
(and you would find it also on French Wikivoyage, if it had the
{{#coordinates}} I wrote about in the previous message).

In other words, you are searching _only_ within English Wikivoyage articles
with the query you posted above. Whether that is enough for you, I cannot
decide.

HTH,
-- [[cs:User:Mormegil | Petr Kadlec]]
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to