Skip to content

Instantly share code, notes, and snippets.

@kimdwkimdw
Created February 22, 2012 06:54
Show Gist options
  • Save kimdwkimdw/1882555 to your computer and use it in GitHub Desktop.
Save kimdwkimdw/1882555 to your computer and use it in GitHub Desktop.
Get Top 10 Favorite Photographer in Raysoda
// http://www.raysoda.com/Com/Photo/List.aspx?f=D&s=RD&d=120217
a = document.createElement('script')
a.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"
document.body.appendChild(a);
Global = [];
function tryParse( num ) {
if (num == 0 ) return;
$.ajax('http://www.raysoda.com/App/Office/List/D.aspx?s=CD&pg='+num)
.success(function(d) {
D = d.split("userLBegin()")[1].split("userLEnd()")[0].trim().split("\n");
console.log('complete')
G= [];
for ( var i = 0 ; i < D.length ; i++) {
var t = D[i].substr(6)
t = t.substr(0,t.length-2)
t = t.split(",")
G[i] = { userid : t[0] , num : parseInt(t[2]) }
}
G = G.sort ( function( a,b) { return b.num - a.num }).slice(0,10);
Global = Global.concat(G);
Global = Global.sort ( function( a,b) { return b.num - a.num }).slice(0,10);
tryParse(num-2);
} )
}
tryParse(1181)
tryParse(1180)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment