Page MenuHomePhabricator

Create prop=categoryinfo
Closed, ResolvedPublic

Description

Author: jutiphan

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


Version: unspecified
Severity: enhancement
URL: http://th.wikipedia.org/w/api.php

Details

Reference
bz13735

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:05 PM
bzimport set Reference to bz13735.

jutiphan wrote:

Thanks! I didn't realize that in the first place.

jutiphan wrote:

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.

(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.

jutiphan wrote:

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!