Last modified: 2012-05-02 16:52:40 UTC
Hi, I'm having trouble using backlinks generator. Page can only be set through gbtitle parameter and not - for instance with titles or pageids. Calling http://sl.wikipedia.org/w/api.php?action=query&generator=backlinks&pageids=1&gbllimit=max&gblnamespace=0&redirects&format=xml returns gblnotitle error, whereas links generator at http://sl.wikipedia.org/w/api.php?action=query&generator=links&pageids=1&gpllimit=max&gplnamespace=0&redirects&format=xml works fine. Best regards, Miha
That's because backlinks is a list module (it's list=backlinks&bltitle=Foo, doesn't work with &titles=Foo) and links is a prop module (prop=links&titles=Foo), so this is intended behavior. I guess this could be made clearer in the documentation.
Then it'd be fine to have blpageid parameter. IDs are especially practical since comparing numbers takes much less computing power than strings.
(In reply to comment #2) > Then it'd be fine to have blpageid parameter. > > IDs are especially practical since comparing numbers takes much less computing > power than strings. Why would you need to compare them if you already know which page you want links for? Do you have a real-world use case in which you have the page ID but not the page title?
Actually I have :) I'm writing simple program to find the shortest path between two Wikipedia articles (using breadth first search algorithm), and it turns out that it's app. 2 times faster when using page IDs instead of page names. Link: http://sis.gimb.si/wikilink/beta.php?start=Delo&target=%C5%A0ahovska%20figura&lang=sl (and another example for english wikipedia) http://sis.gimb.si/wikilink/beta.php?start=Slovenia&target=Sicily
Change summary. This needs a new param to list=backlinks.
commited a patch with Gerrit change #6096
successfully merged