Last modified: 2013-04-12 18:07:54 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 T49173, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47173 - API needs function to only return number of backlinks to an article.
API needs function to only return number of backlinks to an article.
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Unprioritized enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-12 17:15 UTC by Technical 13
Modified: 2013-04-12 18:07 UTC (History)
6 users (show)

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


Attachments

Description Technical 13 2013-04-12 17:15:32 UTC
I asked my question on http://www.mediawiki.org/wiki/API_talk:Main_page#.22What_links_here.22_API_request and http://en.wikipedia.org/wiki/Wikipedia:Village_pump_%28technical%29#API_help_question


I have found that "api.php?action=query&list=backlinks&blnamespace=0&bltitle=" + wgPageName; will tell me if there are any articles that link to the page, but how can I get the full count (if greater than 500)? I don't care "what" articles link there, just how many. I'm trying to write myself a little JavaScript which in part will expand the "What links here" link in my p-tb to include an count of pages that link to a specific NS (or two or three) and a total count of pages that link to that article. I intend to use such a script to save me some time when I'm tagging articles for improvement on enwiki to quickly know if the article is an "orphan" or not. Thank you.

The response I got was: "You cant, that information is not stored in the database, the only way to do that is to retrieve the lists in chunks of 500 until you dont have any more."

I'm requesting this functionality be added to the api.
Comment 1 Technical 13 2013-04-12 17:22:00 UTC
My reasoning for requesting this is that on some of the pages listed http://en.wikipedia.org/wiki/Special:MostLinkedPages would require 9,000+ API requests to populate the list (also, because that special page has the counts readily available, I'm assuming it IS in the database someplace).
Comment 2 Betacommand 2013-04-12 17:29:52 UTC
Its not in the database, those special pages are a real pain to update. I would tend to close this as {{WONTFIX}} due to the limited benefit, and need for high resources to create and maintain this feature. JobQueue and other components would make having this counter consistent unfeasible
Comment 3 Technical 13 2013-04-12 17:39:13 UTC
(In reply to comment #2)
> Its not in the database, those special pages are a real pain to update. I
> would tend to close this as {{WONTFIX}} due to the limited benefit, and need for
> high resources to create and maintain this feature. JobQueue and other
> components would make having this counter consistent unfeasible

Yes, I realize that it those pages with multi-millions of links to are edge cases, but wouldn't having thousands of API requests be more resource intensive?
Comment 4 Brad Jorsch 2013-04-12 18:07:54 UTC
COUNT queries can be expensive, and there is no interesting use case.

The use case you proposed on en:WP:VPT, showing a count in the "what links here" link to determine if something is orphaned, would work equally well if you did just the one backlinks query and displayed ">500" or "501+" or the like if it would need continuation (and really, you could probably limit it to even less for that particular use case).

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


Navigation
Links