Last modified: 2012-05-02 16:52:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32488, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30488 - API: Allow listing of backlinks per pageid
API: Allow listing of backlinks per pageid
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 27810
  Show dependency treegraph
 
Reported: 2011-08-21 12:38 UTC by Mihael Simonič
Modified: 2012-05-02 16:52 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mihael Simonič 2011-08-21 12:38:35 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
Comment 1 Roan Kattouw 2011-08-21 13:12:22 UTC
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.
Comment 2 Mihael Simonič 2011-08-21 14:08:28 UTC
Then it'd be fine to have blpageid parameter.

IDs are especially practical since comparing numbers takes much less computing power than strings.
Comment 3 Roan Kattouw 2011-08-21 16:13:03 UTC
(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?
Comment 4 Mihael Simonič 2011-08-21 16:36:57 UTC
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
Comment 5 Umherirrender 2012-04-29 19:56:43 UTC
Change summary. This needs a new param to list=backlinks.
Comment 6 Umherirrender 2012-04-29 20:15:50 UTC
commited a patch with Gerrit change #6096
Comment 7 Umherirrender 2012-05-02 16:52:40 UTC
successfully merged

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links