Template:Mostvisited

$.getJSON("/api/v1/Articles/Top?cb=" + new Date.getTime, function(data) {	var a = data.items; // array of results	$("span.mostvisited").each(function { var b = String(Number($(this).attr("data-limit"))) == "NaN" ? a.length : Number($(this).attr("data-limit")) > a.length ? a.length : Number($(this).attr("data-limit")), // limit (if larger than the results length, override with length of results))			c = [];		for (var i = 0; i < b; i++) {			c.push('\t' + a[i].title + '');			if (i + 1 == b) {				$(this).replaceWith('\n' + c.join("\n") + '\n');			}		}	}); });