Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Page MenuHomePhabricator

Provide an API that just outputs the count
Open, LowPublicFeature

Description

On Wikimedia Commons we have some scripts that only have to bother about the count of global usages, not where it is used. These main types are there:

  • Script that request CommonsDelinker to replace files across wiki projects simply want to know: Used or not?
  • The user-gallery-script could provide these information so the user gets an idea what kind of images are often used and what not
  • A script that is assisting creating deletion requests could display this number so it is easier to find files not being in project scope (a file is in scope automatically if it is used in an other Wikimedia Project) and those you better don't touch

This is currently possible when querying a single file. But when it comes to multiple files, the global usage is limited to 500 entries in total, not per file.

Either a limit per file is introduced (I would set it to a low number for most tools) or something that returns the number is required.

Thank you.


Version: unspecified
Severity: enhancement

Details

Reference
bz36912

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:28 AM
bzimport added a project: GlobalUsage.
bzimport set Reference to bz36912.
bzimport added a subscriber: Unknown Object (MLST).

See also bug 17993

Can't you just limit the query to say 5 results, and if you get >= 1 result, you know it's used?

If I would query each single file this would be Ok. But if I want to know whether 100 files are globally used, I don't want to send 100 requests.

Therefore I do it this way:
https://commons.wikimedia.org/w/api.php?action=query&prop=globalusage&titles=File:Example.jpg|File:Example.png&gulimit=5

The response does not give any results for File:Example.png, only for File:Example.jpg

Since the count is requested in bug 17993, perhaps this bug could suggest limiting the results per item (File in this case) when querying multiple titles because the same applies for categories and other stuff.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:14 AM
Aklapper removed a subscriber: wikibugs-l-list.