Skip to content

Instantly share code, notes, and snippets.

@bashtoni
Created July 10, 2013 14:07
Show Gist options
  • Save bashtoni/5966573 to your computer and use it in GitHub Desktop.
Save bashtoni/5966573 to your computer and use it in GitHub Desktop.
Live test match score for dashing
require 'json'
require 'net/http'
SCHEDULER.every '30s', :first_in => 5 do |job|
resp = Net::HTTP.get_response(URI.parse('http://cdnedge.bbc.co.uk/feeds/hi/english/static/cricket/statistics/scorecards/2013/07/87719/live_scorecard.json'))
data = resp.body
result = JSON.parse(data)
text = "<p>" + result["scorecard"]["teamASummary"] + "</p><p>" + result["scorecard"]["teamBSummary"] + "</p>"
send_event('ashes', text: text)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment