Usage examples while waiting for docs
JavaScript Site Monitor in 20 lines of code or less....
$(document).ready(function siteMonitor() {
var apiKey = '';
var sites = ["stackoverflow", "serverfault", "superuser", "meta.stackoverflow", "stackapps"];
var siteIndex = 0;
var delay = 10;
$.each(sites,
function(idx, itm) {
$('<div/>').addClass('stats').attr('id', itm.replace('.', '')).appendTo(document.body);
});
function update() {
var client = new Soapi.Client(sites[siteIndex], apiKey)
.Stats()
.getResult(function(data) {
var id = sites[siteIndex].replace('.', '');
$('#' + id).hide().fadeIn(100).jqotesub("#template", data.statistics[0]);
-
siteIndex++;
if (siteIndex == sites.length) {
siteIndex = 0;
delay = 5000;
}
window.setTimeout(update, delay);
});
}
update();
});