Created
July 10, 2013 14:07
-
-
Save bashtoni/5966573 to your computer and use it in GitHub Desktop.
Live test match score for dashing
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
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