Page MenuHomePhabricator

API: Allow listing of backlinks per pageid
Closed, ResolvedPublic

Description

Author: smihael

Description:
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


Version: unspecified
Severity: normal

Details

Reference
bz30488

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:48 PM
bzimport set Reference to bz30488.
bzimport added a subscriber: Unknown Object (MLST).

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.

smihael wrote:

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?

smihael wrote:

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 6096