Sxerks wrote:
The closest date you could get, would be the earliest edit on the main page, just check its history.
It's possible the earliest edit isn't to the main page or that the earliest date is an imported edit. Something like the following might work.
(function (mw, $) {
'use strict';
var
MAXREQ = 50,
urlAPI = mw.config.get('wgScriptPath') + '/api.php',
opts = {
format: 'json',
action: 'query',
prop: 'revisions',
rvprop: 'ids|timestamp'
},
start = 1;
// return an array of sequential integers
function seq(start, length) {
var
r = [],
i;
for ( i = 0; i < length; ++i ) {
r.push(start++);
}
return r;
}
(function loop() {
opts.revids = seq(start, MAXREQ).join('|');
$.getJSON(urlAPI, opts).done(function (data) {
var
p = data && data.query && data.query.pages,
i, j, r;
if (p) {
for (i in p) {
if (p.hasOwnProperty(i)) {
r = p[i].revisions[0];
if (!j || (r.revid < j.revid)) {
j = r;
}
}
}
alert('oldid = ' + j.revid + '\n' + j.timestamp);
} else {
start += MAXREQ;
loop();
}
});
}());
}(mediaWiki, jQuery));
EDIT: It seems if the earliest non-deleted edit is an import (like from starter.wikia.com), you won't get the correct date. Bummer.