Hello all.
I want to ask is it possible to know the total rows if I use list query? For example, I want to know how many editor are there, before making this kind of request: api.php?action=query&list=allusers&augroup=editor and repeatly using param query-continue aufrom later.
And is it possible to sort the query result. For example by userid or registration time? Thank you.
Regards, William
On Fri, Jun 28, 2013 at 9:50 PM, William Surya P zarambie_game@yahoo.com wrote:
I want to ask is it possible to know the total rows if I use list query? For example, I want to know how many editor are there, before making this kind of request: api.php?action=query&list=allusers&augroup=editor and repeatly using param query-continue aufrom later.
No. Doing this would require that the server actually fetch all those rows in order to count them, which would defeat the purpose of having a limit.
And is it possible to sort the query result. For example by userid or registration time?
The results will always be sorted in some manner, in this case by username. There's no way to change the sort order for list=allusers, as the ordering is constrained by the ways the rows can be efficiently fetched from the database. If you need other sort orders, you'll have to fetch them and then sort them in your client.
Okay. Thank you for your answer.
Regards, William.
----- Pesan Asli ----- Dari: Brad Jorsch (Anomie) bjorsch@wikimedia.org Kepada: MediaWiki API announcements & discussion mediawiki-api@lists.wikimedia.org Cc: Dikirim: Sabtu, 29 Juni 2013 9:09 Judul: Re: [Mediawiki-api] Ask about list query
On Fri, Jun 28, 2013 at 9:50 PM, William Surya P zarambie_game@yahoo.com wrote:
I want to ask is it possible to know the total rows if I use list query? For example, I want to know how many editor are there, before making this kind of request: api.php?action=query&list=allusers&augroup=editor and repeatly using param query-continue aufrom later.
No. Doing this would require that the server actually fetch all those rows in order to count them, which would defeat the purpose of having a limit.
And is it possible to sort the query result. For example by userid or registration time?
The results will always be sorted in some manner, in this case by username. There's no way to change the sort order for list=allusers, as the ordering is constrained by the ways the rows can be efficiently fetched from the database. If you need other sort orders, you'll have to fetch them and then sort them in your client.
Hello all.
I want to ask about how mediawiki api count active users.
When, I see site statistic: (https://id.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop...) it said that, there are 1743 activeusers.
But when I list all of the activeusers (with auactiveusers) (https://id.wikipedia.org/w/api.php?action=query&list=allusers&auprop...) there are more than 1743 rows. (and my application crash because the progress bar value is beyond the maximum limit)
Anyone can explain?
Then, it also has different result with the special page (active user) (https://id.wikipedia.org/wiki/Istimewa:Pengguna_aktif). Is it possible to extract data from mediawiki api that has the same result with Special:ActiveUsers page?
Thank you.
Regards, William
_______________________________________________ Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Hello all.
I want to ask about how mediawiki api count active users.
When, I see site statistic: (https://id.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop...) it said that, there are 1743 activeusers.
But when I list all of the activeusers (with auactiveusers) (https://id.wikipedia.org/w/api.php?action=query&list=allusers&auprop...) there are more than 1743 rows. (and my application crash because the progress bar value is beyond the maximum limit)
Anyone can explain?
Then, it also has different result with the special page (active user) (https://id.wikipedia.org/wiki/Istimewa:Pengguna_aktif). Is it possible to extract data from mediawiki api that has the same result with Special:ActiveUsers page?
Thank you.
Regards, William
On 11/07/13 11:00, William Surya P wrote:
Hello all.
I want to ask about how mediawiki api count active users.
When, I see site statistic: (https://id.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop...) it said that, there are 1743 activeusers.
But when I list all of the activeusers (with auactiveusers) (https://id.wikipedia.org/w/api.php?action=query&list=allusers&auprop...) there are more than 1743 rows. (and my application crash because the progress bar value is beyond the maximum limit)
Anyone can explain?
Then, it also has different result with the special page (active user) (https://id.wikipedia.org/wiki/Istimewa:Pengguna_aktif). Is it possible to extract data from mediawiki api that has the same result with Special:ActiveUsers page?
Thank you.
Regards, William
https://id.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop... gives me the same value as https://id.wikipedia.org/wiki/Istimewa:Statistik, as expected.
It's strange that https://id.wikipedia.org/w/api.php?action=query&list=allusers&auprop... (3798) gives more users than https://id.wikipedia.org/w/index.php?title=Istimewa:Pengguna_aktif&limit... (1270) though.
mediawiki-api@lists.wikimedia.org