Skip to content

Instantly share code, notes, and snippets.

@jacobk
Created December 12, 2011 17:41
Show Gist options
  • Save jacobk/1468301 to your computer and use it in GitHub Desktop.
Save jacobk/1468301 to your computer and use it in GitHub Desktop.
# Get money donated to musikhjälpen 2011
#
# show me the money - returns how much money that has been donated
#
module.exports = (robot) ->
robot.respond /(show me the money|mh)/i, (msg) ->
msg.http("http://sverigesradio.se/p3/musikhjalpen/xml/ticker.htm")
.get() (err, res, body) ->
if res.statusCode is 200
data = JSON.parse(body)
msg.send "#{data.total} donated so far"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment