Skip to content

Instantly share code, notes, and snippets.

@JamieMagee
Created September 6, 2013 18:06
Show Gist options
  • Save JamieMagee/6467603 to your computer and use it in GitHub Desktop.
Save JamieMagee/6467603 to your computer and use it in GitHub Desktop.
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