Created
December 8, 2011 23:18
-
-
Save ChrisMBarr/1449196 to your computer and use it in GitHub Desktop.
Get all the score numbers from ESPN and sort them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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;})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!