kynikos / wiki-monkey

MediaWiki-compatible bot and editor assistant running directly in the browser and expandable with plugins.
https://github.com/kynikos/wiki-monkey/wiki
GNU General Public License v3.0
15 stars 5 forks source link

Sort ArchWiki admins and maintainers by activity #174

Closed kynikos closed 10 years ago

kynikos commented 10 years ago

Keep the usernames in https://wiki.archlinux.org/index.php/ArchWiki:Administrators and https://wiki.archlinux.org/index.php/ArchWiki:Maintainers sorted by the number contributions in the last 30 days ( https://wiki.archlinux.org/api.php?action=query&list=allusers&auwitheditsonly=1&auprop=groups%7Cimplicitgroups%7Ceditcount&auactiveusers=1 ). Maintain a commented-out JSON object in those pages with the white list of usernames (don't show who hasn't given authorization unless he was already there) and their email addresses. Probably also use the number of contributions with any associated bot accounts.

lahwaacz commented 10 years ago

Strange, the API request shows different values than Special:ActiveUsers page. At least for some users, e.g. my bot and your regular account.

kynikos commented 10 years ago

Ouch... I smell an upstream bug... I wonder how you've managed to notice this :P Good job, I'll investigate, but I don't think this will stop me from implementing this feature >;)

lahwaacz commented 10 years ago

Note that when different, the value from api request seems to be double of the right value. Perhaps some other actions are counted - my first thought was the autopatrol log, but that does not fit with other accounts where the values are the same...

kynikos commented 10 years ago

For what I've seen, it happens only when groups is among auprop's values. Regarding this WM's issue, querying groups wouldn't be needed, so we're safe. It's worth to collect some more info if possible and report it upstream though: since you've discovered the bug, I'll let you report it of course.

kynikos commented 10 years ago

There are so many values off also on Wikipedia, not only with a 2:1 ratio. Compare for example:

kynikos commented 10 years ago

Um... I pasted those queries here from an old note in my Tasks page on the wiki, but probably this feature would better be based on list=usercontribs queries.

kynikos commented 10 years ago

First, I've changed my mind again, I'll use list=allusers in the end. Second, I've sort of understood when the edits count is multiplied: it happens for users who belong to more than one group, their edits are mulitplied for the number of queried groups they belong to. For example compare:

I would consider it a bug, it's not expected at all, nor is it documented.

lahwaacz commented 10 years ago

Nice catch, but I still don't understand why only one account (the bot) is affected in this query.

Not that it matters to this issue, but list=allusers with auprop=groups also returns max 4 groups per user (Lahwaacz.bot is member of 5 groups as confirmed by [1]). Probably the whole module is rather buggy...

kynikos commented 10 years ago

Only some groups affect the count, specifically the ones automatically listed in https://wiki.archlinux.org/api.php under list=allusers > augroup, which in our case are bot, sysop, bureaucrat, maintainer. Of your 2 accounts, the normal one only belongs to the maintainer group, while the bot also belongs to bot. I think now it's easy to understand how to reproduce the bug. It happens with action=query&list=allusers&auactiveusers=1 in 2 cases:

I can't reproduce your last problem about the limit of 4 groups per user: for example https://wiki.archlinux.org/api.php?action=query&list=allusers&aulimit=1&aufrom=Kynikos&auprop=groups returns all the 5 groups that also https://wiki.archlinux.org/api.php?action=query&meta=userinfo&uiprop=groups returns for me (the latter query depends on the current user, so I can't see your output).

EDIT: https://wiki.archlinux.org/api.php?action=query&list=allusers&aulimit=1&aufrom=Lahwaacz.bot&auprop=groups does return 5 groups to me

lahwaacz commented 10 years ago

It seems that adding auactiveusers to the query has an unexpected side effect in limiting the number of groups returned by auprop=groups to 4.

kynikos commented 10 years ago

Eheh confirmed, perhaps it's due to the same bug in the code.

kynikos commented 10 years ago

Bugs reported:

I'll keep tracking them in #179