Created
September 6, 2013 18:06
-
-
Save JamieMagee/6467603 to your computer and use it in GitHub Desktop.
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
fns = players.map (player) -> | |
(cb) -> | |
msg.http("http://pwa.wp3.pl/curvefever/?player=" + player).get() (err, res, body) -> | |
$ = cheerio.load(body) | |
results.push | |
name: $("b").slice(0).eq(0).text().toLowerCase() | |
rank: parseInt($("td").slice(37).eq(0).text(), 10) | |
cb() | |
async.parallel fns, -> | |
results.sort (x,y) -> y.rank - x.rank | |
for player in results | |
msg.send player.name + " " + player.rank |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment