Author Topic: NIWA Stats  (Read 22639 times)

Offline Vellidragon

  • Hungry dragoness
  • WiKirby Staff
  • ***
  • Posts: 74
  • Gender: Female
  • That fat girl
    • View Profile
    • Pelsatia
Re: NIWA Stats
« Reply #20 on: March 22, 2012, 06:48:56 PM »
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.)

Offline Greenpickle

  • Forum Administrator
  • *****
  • Posts: 470
  • Gender: Male
    • View Profile
    • My site
Re: NIWA Stats
« Reply #21 on: March 22, 2012, 07:54:24 PM »
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:

Code: [Select]
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:

Code: [Select]
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'])

Offline Xizor

  • Zelda Wiki Bureaucrat
  • Forum Administrator
  • *****
  • Posts: 882
  • Gender: Male
  • Talk to me. :)
    • View Profile
    • Legend of Zelda.com
Re: NIWA Stats
« Reply #22 on: March 25, 2012, 01:37:55 PM »
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. :)
« Last Edit: March 25, 2012, 01:56:55 PM by Xizor »



Bureaucrat of

Offline Greenpickle

  • Forum Administrator
  • *****
  • Posts: 470
  • Gender: Male
    • View Profile
    • My site
Re: NIWA Stats
« Reply #23 on: March 25, 2012, 06:51:43 PM »
Pretty sure it's 30 days at every wiki.

Offline Vellidragon

  • Hungry dragoness
  • WiKirby Staff
  • ***
  • Posts: 74
  • Gender: Female
  • That fat girl
    • View Profile
    • Pelsatia
Re: NIWA Stats
« Reply #24 on: March 25, 2012, 06:59:32 PM »
Pretty sure it's 30 days at every wiki.
"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.
« Last Edit: March 25, 2012, 07:09:36 PM by Vellidragon »

Offline Greenpickle

  • Forum Administrator
  • *****
  • Posts: 470
  • Gender: Male
    • View Profile
    • My site
Re: NIWA Stats
« Reply #25 on: March 25, 2012, 07:15:18 PM »
Hmm, okay.  Interesting...

Offline FlyingRagnar

  • Dragon Quest Wiki Staff
  • ***
  • Posts: 111
    • View Profile
    • Dragon Quest Wiki
Re: NIWA Stats
« Reply #26 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.

Offline porplemontage

  • Super Mario Wiki Staff
  • ***
  • Posts: 44
  • Gender: Male
  • Mario was here
    • View Profile
    • Super Mario Wiki
Re: NIWA Stats
« Reply #27 on: March 27, 2012, 04:56:16 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

Offline FlyingRagnar

  • Dragon Quest Wiki Staff
  • ***
  • Posts: 111
    • View Profile
    • Dragon Quest Wiki
Re: NIWA Stats
« Reply #28 on: March 27, 2012, 05:51:04 PM »
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. 

Offline FlyingRagnar

  • Dragon Quest Wiki Staff
  • ***
  • Posts: 111
    • View Profile
    • Dragon Quest Wiki
Re: NIWA Stats
« Reply #29 on: March 30, 2012, 05:16:41 AM »
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!

Offline Greenpickle

  • Forum Administrator
  • *****
  • Posts: 470
  • Gender: Male
    • View Profile
    • My site
Re: NIWA Stats
« Reply #30 on: March 30, 2012, 09:13:00 AM »
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.
« Last Edit: March 30, 2012, 09:19:31 AM by Greenpickle »

Offline FlyingRagnar

  • Dragon Quest Wiki Staff
  • ***
  • Posts: 111
    • View Profile
    • Dragon Quest Wiki
Re: NIWA Stats
« Reply #31 on: March 30, 2012, 04:08:31 PM »
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. 

Offline Greenpickle

  • Forum Administrator
  • *****
  • Posts: 470
  • Gender: Male
    • View Profile
    • My site
Re: NIWA Stats
« Reply #32 on: March 30, 2012, 04:33:09 PM »
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.

Offline FlyingRagnar

  • Dragon Quest Wiki Staff
  • ***
  • Posts: 111
    • View Profile
    • Dragon Quest Wiki
Re: NIWA Stats
« Reply #33 on: March 30, 2012, 04:47:09 PM »
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.

Offline FlyingRagnar

  • Dragon Quest Wiki Staff
  • ***
  • Posts: 111
    • View Profile
    • Dragon Quest Wiki
Re: NIWA Stats
« Reply #34 on: April 03, 2012, 04:47:38 PM »
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?

Offline Moydow

  • NIWA Coordinator
  • Forum Administrator
  • *****
  • Posts: 483
    • View Profile
    • Fire Emblem Wiki
Re: NIWA Stats
« Reply #35 on: April 03, 2012, 05:05:59 PM »
Bulbagarden and Bulbapedia use Bulbagarden Archives for media storage for the entire site instead, similar to Wikimedia and the Wikimedia Commons.
NIWA Coordinator

Offline Bop1996

  • Kreatz
  • Super Mario Wiki Staff
  • ***
  • Posts: 8
  • Gender: Male
  • "I love this kinda stuff!"
    • View Profile
Re: NIWA Stats
« Reply #36 on: April 03, 2012, 05:26:45 PM »
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.

Offline Greenpickle

  • Forum Administrator
  • *****
  • Posts: 470
  • Gender: Male
    • View Profile
    • My site
Re: NIWA Stats
« Reply #37 on: April 03, 2012, 05:37:50 PM »
Are you still going to be gathering data for the number of edits per week?

Offline FlyingRagnar

  • Dragon Quest Wiki Staff
  • ***
  • Posts: 111
    • View Profile
    • Dragon Quest Wiki
Re: NIWA Stats
« Reply #38 on: April 03, 2012, 07:24:44 PM »

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

Offline Toomai

  • SmashWiki Staff
  • ***
  • Posts: 106
  • Gender: Male
  • Smash & Learn
    • View Profile
    • SmashWiki
Re: NIWA Stats
« Reply #39 on: April 03, 2012, 09:54:03 PM »
Here, have some graphs:


oeuf