So after Jagex’s horrendous admission that 60% of their active players were actually bots, I was curious to see if anyone had kept any statistics over time on the actual active player counts. Unfortunately it doesn’t look like there has been and the domain is excluded from the wayback machine, so any historical data for funsies is out the window as well.
I looked around for a quick, easy way to keep track from now onwards and it turns out google docs is fantastic; five lines of code later it’s scraping the runescape homepage and dumping date+counts into a spreadsheet. There is a limit of 400,000 cells per spreadsheet which means I’ll be able to keep grabbing the data for the next 22 years (ish) and it also emails me when the script fails (just in case their website undergoes any redesign). Unfortunately they don’t publish a world list outside of the client anymore so I won’t be able to pull any cool stats out like members vs non member numbers, but you get that.
It will be interesting to plug this into the google charts api (or some other such fancyness) along with dates such as when any major bots come online.
For anyone that’s interested, this is all the code:
[code]function myFunction() {
var count = UrlFetchApp.fetch(“http://www.runescape.com/title.ws”).getContentText().match(/([\d,]+) people currently online/im);
var forums = UrlFetchApp.fetch(“http://services.runescape.com/m=forum/forums.ws”).getContentText().match(/([\d,]+) active users/im);
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var start = sheet.getRange(“j2”);
var cell = sheet.getRange(start.getValue());
var ct = 0;
while ( cell.offset(ct, 0).getValue() != “” ) {
ct++;
}
cell.offset(ct, 0).setValue(Utilities.formatDate(new Date(), “GMT”, “yyyy-MM-dd’T’HH:mm:ss.SSSZ”));
cell.offset(ct, 1).setValue(count[1].replace(",", “”));
cell.offset(ct, 2).setValue(forums[1].replace(",", “”));
start.setValue(cell.offset(ct, 0).getA1Notation());
}
function viewsinc() {
var cell = SpreadsheetApp.getActiveSpreadsheet().getRange(‘j1’);
cell.setValue(cell.getValue() + 1);
}[/code]
With a trigger on myFunction to run every hour and a trigger on viewsinc to run when the ss opens (made a few changes since the first one, so a few more lines than 5 now :P).