Skip to content

Instantly share code, notes, and snippets.

@ChrisMBarr
Created December 8, 2011 23:18
Show Gist options
  • Save ChrisMBarr/1449196 to your computer and use it in GitHub Desktop.
Save ChrisMBarr/1449196 to your computer and use it in GitHub Desktop.
Get all the score numbers from ESPN and sort them
var scores=[];
jQuery(".scores").each(function(i){
jQuery.each(jQuery(this).text().split("-"), function(key,value){
scores.push(parseInt(value));
})
});
console.log(scores.sort(function(a,b){return a-b;}));
@ChrisMBarr
Copy link
Author

Go here: http://espn.go.com/sports/scores
Click Recently Completed

Paste the code in the JS console and press return.

Yay, now you have all the recent sports scores as numbers in ascending order!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment