• Welcome to NIWA Community Forums.
 

NIWA Stats

Started by FlyingRagnar, November 08, 2011, 03:27:30 PM

Previous topic - Next topic

Vellidragon

What would "editors" include? All registered users or only those with some sort of activity? Just wondering, as there's an "Active users" page with "users who had some kind of activity within the last 91 days" among the special pages. Counting these manually, WiKirby currently has 55, if anyone cares.

(I'm probably completely missing something here, so I apologise for my childish ignorance.)

Greenpickle

Active users sounds like a good measure of the number of editors.  You can easily grab it from the MediaWiki API.  For example, you can get the general statistics, including active users, for Pikipedia, at:

http://www.pikminwiki.com/api.php?format=json&action=query&meta=siteinfo&siprop=statistics

You can fetch and parse this for active users fairly easily - for example, in JavaScript for non-IE:


var api = 'http://www.pikminwiki.com/api.php';
var r = new XMLHttpRequest();
r.open('GET', api + '?format=json&action=query&meta=siteinfo&siprop=statistics', false);
r.send(null);
alert(JSON.parse(r.responseText).query.statistics.activeusers);


Or in Python 3:


from urllib.request import urlopen
from json import loads
api = 'http://www.pikminwiki.com/api.php'
print(loads(urlopen(api + '?format=json&action=query&meta=siteinfo&siprop=statistics').read().decode())['query']['statistics']['activeusers'])

Xizor

#22
I was thinking just registered members, but active users is probably much better!

Edit: Btw, Zelda Wiki caps it off at 30 days, so there needs to be some consistency between Wikis if we're to use this a valid, uniform stat, but anyway, within the last 30 days, 121 people have edited ZW. :)

Also, another fun stat to compile could be the total article count of all of NIWA. :)



Bureaucrat of

Greenpickle

Pretty sure it's 30 days at every wiki.

Vellidragon

#24
Quote from: Greenpickle on March 25, 2012, 06:51:43 PM
Pretty sure it's 30 days at every wiki.
Quote from: Vellidragon on March 22, 2012, 06:48:56 PM
"users who had some kind of activity within the last 91 days"
That's an exact quote from the Active Users page on WiKirby, so evidently, it's not 30 days everywhere.

EDIT: Just checked random wikis, and Wars Wiki, for instance, also has 91 days. There's definitely wikis with 30 as well, though.

EDIT2: Lylat Wiki and Starfy Wiki also have 91 days. The rest all seem to have 30, unless I forgot one.

Greenpickle

Hmm, okay.  Interesting...

FlyingRagnar

Looks like it should be controlled by $wgActiveUserDays.  30 is the default.  Not sure why it would be set to 91 for any wiki, weird.

porplemontage

Quote from: FlyingRagnar on March 27, 2012, 04:29:45 PM
Looks like it should be controlled by $wgActiveUserDays.  30 is the default.  Not sure why it would be set to 91 for any wiki, weird.

Older versions of MediaWiki.
Steve

FlyingRagnar

Yeah that's what I figured, but looking at the history of the article, it never lists a value different than 30.  Probably undocumented in earlier versions or something. 

FlyingRagnar

http://pastebin.com/Ww6MmvPR

Here is a python script I threw together based on Greenpickle's suggestion above.  It grabs various statistics from each wiki and puts it into a very basic html table.  A couple things...

1) Can one of you with better web hosting put this on a cron?  My hosting only has python 2.4 which does not support the JSON library (2.6+). 

2) I could not find the api.php for the Wars Wiki.  Seems like it should be http://www.warswiki.warscentral.com/api.php.  So that wiki is currently missing. 

The script does not do any sort of error handling at all.  The value for active users it spit out for me (minus Wars wiki) was 1893!

Greenpickle

#30
For (1), since you're fetching from trusted sources, and you're quite sure the output will be valid JSON, you can just eval() it.

Quite important: you're fetching and parsing the page for every category, but you only need to do it once per wiki.  This obviously makes it run about 6 times as fast.

As for errors, if you weren't sure, urlopen gives IOError when the page is dead (or maybe it does so on .read()), and the API will give errors in the returned data structure (in the 'error' key, I think?).  Checking a page is valid JSON kind of conflicts with what I said for (1), so maybe you could have a hack like checking for fetched_string.startswith('{"query":') ?

(...And I'm struggling to refrain from complaining about your HTML - I'm telling myself it doesn't matter.)

Edit: looking at the difference between this table each month might be a better way of getting the monthly edits, too.

FlyingRagnar

Haha, you are so critical.  :)  This was just 10 minutes of work, and I never write Python.  Feel free to make some quick changes and post an updated script.  I didn't work on it longer because I figured out that my hosting doesn't have Python 2.6+, so I kinda quit then. 

I will work on it again when I have some time. 

Greenpickle

Hey, the only point of criticism was the bit about only fetching once per wiki, and that's pretty important; the rest were just general thoughts.

FlyingRagnar

Oh yeah, I totally understand.  I'm thinking the cron would only run once a day, more than that and the stats probably aren't more meaningful.  So even if it was a slow process, it wouldn't matter much.  Of course, things are still thrown off by the fact that some wikis have 91 days for active users and others 30.  There are probably other config settings that skew the values.

FlyingRagnar

NIWA Statistics
Wiki NameArticlesEditsMediaUsersActive UsersAdmins
Pikipedia59737422173731889
Bulbapedia2115916471330624428329
Donkey Kong Wiki900116642334465145
Fire Emblem Wiki872237386402237157
F-Zero Wiki218943533258168
Golden Sun Universe1421502934014855125
Icaruspedia2714968620112566
Lylat Wiki1643891410502691611
Metroid Wiki152141021268218131710
Nintendo Wiki5181401061130289
Nookipedia135528669396112373410
Pikmin Fanon Wiki1647263381804231147
Smash Wiki206810506759831194889
Starfy Wiki72513535157792127
Strategy Wiki2355959801880586600087832
Mario Wiki121211272908364072334848912
Wikibound977201812415569134
Wikirby740193852175668454
Zelda Wiki362930153813834976312117
Dragon Quest Wiki2657297244937287153
Totals7711942939611734611642681903184
2012-04-03 12:40:03.384798

Not sure why Bulbapedia has no media/images.  Maybe because they are using a customized storage system for their files?

Moydow

Bulbagarden and Bulbapedia use Bulbagarden Archives for media storage for the entire site instead, similar to Wikimedia and the Wikimedia Commons.
NIWA Coordinator

Bop1996

Metroid Wiki had a fairly good month compared to what activity has been like lately. Of those 17 active users, three were admins, and most of the rest were people that edited once or twice and then didn't edit anymore, tho.

Greenpickle

Are you still going to be gathering data for the number of edits per week?

FlyingRagnar



Wiki NameAverage Posts Per WeekPercentageChange
Bulbapedia4342.336.83%-1.95%
Donkey Kong Wiki111.50.95%-23.68%
Dragon Quest Wiki38.50.33%
Fire Emblem Wiki371.93.15%+54.57%
F-Zero Wiki940.80%
Golden Sun Universe76.80.65%+3.50%
Icaruspedia226.61.92%
Lylat Wiki8.40.07%+140.00%
Mario Wiki2806.323.80%+8.13%
Metroid Wiki190.91.62%-3.05%
Nintendo Wiki47.10.40%+20.77%
Nookipedia60.90.52%-13.62%
Pikipedia69.30.59%+10.35%
Pikmin Fanon490.42%-2.39%
SmashWiki11659.88%+2.48%
Starfy Wiki474.44.02%+29.02%
StrategyWiki765.36.49%+43.05%
Wars Wiki71.60.61%+38.76%
Wikibound102.20.87%+35.54%
WiKirby40.10.34%-35.11%
Zelda Wiki678.15.75%-32.54%
Total11790.2100.00%+5.82%
Avg Posts Per Week561.4380952-9.29%
Date4/3/2012

Toomai

Here, have some graphs:


oeuf