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

bzimport added a project: MediaWiki-API.Via ConduitNov 21 2014, 10:05 PM
bzimport set Reference to bz13735.
bzimport created this task.Via LegacyApr 13 2008, 8:12 PM
bzimport added a comment.Via ConduitApr 14 2008, 1:15 PM

jutiphan wrote:

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

bzimport added a comment.Via ConduitApr 14 2008, 11:56 PM

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.

Catrope added a comment.Via ConduitApr 26 2008, 1:46 PM

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

bzimport added a comment.Via ConduitApr 26 2008, 2:10 PM

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!

Catrope added a comment.Via ConduitApr 26 2008, 2:12 PM

Will do

Catrope added a comment.Via ConduitApr 26 2008, 3:35 PM

Added in r33914

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.