Last modified: 2008-04-26 15:35:02 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 T15735, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 13735 - Create prop=categoryinfo
Create prop=categoryinfo
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
http://th.wikipedia.org/w/api.php
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-13 20:12 UTC by Jutiphan
Modified: 2008-04-26 15:35 UTC (History)
3 users (show)

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


Attachments

Description Jutiphan 2008-04-13 20:12:42 UTC
I would like to ask for the feature to have the property to get pages count on the given category, with an option of not having category titles returned to save bandwidth when just wanting the count.

I noticed the latest MediaWiki is now able to provide the total pages count on each category now, so hopefully should not be a lot of work for the API.
Comment 1 Victor Vasiliev 2008-04-14 13:01:48 UTC
You can do it with list=allcategories:
http://www.mediawiki.org/w/api.php?action=query&list=allcategories&acprop=size&acfrom=Configure&aclimit=1
Comment 2 Jutiphan 2008-04-14 13:15:47 UTC
Thanks! I didn't realize that in the first place.
Comment 3 Jutiphan 2008-04-14 23:56:28 UTC
It turns out that I need this property in list=categorymembers. I am suggesting that it would be nice to have size property in cmprop. This is so that I can specify the categories I want to get the size on. list=allcategories do not allow me to do that. Thanks.
Comment 4 Roan Kattouw 2008-04-26 13:46:47 UTC
(In reply to comment #3)
> It turns out that I need this property in list=categorymembers. I am suggesting
> that it would be nice to have size property in cmprop. This is so that I can
> specify the categories I want to get the size on. list=allcategories do not
> allow me to do that. Thanks.
> 

That doesn't make much sense. Using allcategories this way (with acfrom=Foo&aclimit=1) only allows fetching data for one category at a time, but the same is true for categorymembers, which only allows listing the members of one category at a time. If you want to get the size *and* members of a category, you can combine the requests:

http://www.mediawiki.org/w/api.php?action=query&list=allcategories|categorymembers&acprop=size&acfrom=Configure&aclimit=1&cmtitle=Category:Configure

Marking this as WORKSFORME, as there is a way to do it already.
Comment 5 Jutiphan 2008-04-26 14:10:42 UTC
OK. Basically, I have a scenario where I would like to be able to pass in multiple titles of categories and get the size and other info of those categories all in one query. I guess what I would like is to have something like cmtitles where I can pass the names of categories I would like to get info. on. categorymembers and allcategories doesn't let me do that.

One scenario I may use this for an example is to calculate of statistics such as
Category:A-class abc articles, Category:B-class abc articles, and so forth. This feature would allow me to pass in those titles I already know to get the info of them. Sorry for not being so clear earlier. If there is a way to do this already, please tell me. Thanks!
Comment 6 Roan Kattouw 2008-04-26 14:12:48 UTC
Will do
Comment 7 Roan Kattouw 2008-04-26 15:35:02 UTC
Added in r33914

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


Navigation
Links