Last active
December 31, 2015 07:39
-
-
Save rystaf/7955532 to your computer and use it in GitHub Desktop.
Top 10 as voted for in comments http://www.polygon.com/2013/12/12/5201622/help-us-decide-the-besties-best-games-of-the-year
This file contains hidden or 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
| x = {}; | |
| $('#comments_list strong').each( | |
| function(){ | |
| if(!x[this.innerHTML]) x[this.innerHTML] = 0; | |
| x[this.innerHTML]++; | |
| } | |
| ); | |
| var t = []; | |
| for (var g in x) t.push([g, x[g]]); | |
| t.sort(function(a,b) {return b[1] - a[1]}); | |
| text = ''; | |
| t.slice(1,10).forEach( | |
| function(b){ | |
| text += ( b[0] + ': ' + b[1] + '\n') | |
| } | |
| ); | |
| alert(text); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment