Skip to content
This repository has been archived by the owner. It is now read-only.
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (33 sloc) 1.2 KB
# Description:
# Display cricket scores for current live games
# Dependencies:
# None
# Configuration:
# None
# Commands:
# hubot cricket scores for <team> - Returns the current score of live game
# hubot cricket scores for all - Returns the current score of all live games
# Author:
# adtaylor
module.exports = (robot) ->
feed_url = ""
prefix = "CRICKET SCORE: "
robot.respond /cricket scores for (.*)/i, (msg) ->
query = msg.match[1]?.toUpperCase()
.get() (err, res, body) ->
results = JSON.parse body
scores = results.query.results?.item
if not scores then return msg.send prefix + "No games currently in progress."
if query is "ALL"
scores.forEach (score)->
msg.send prefix + score.title
scores.forEach (score)->
if score.title.toUpperCase().search(query) isnt -1 then msg.send prefix + score.title
robot.respond /do you like cricket?(.*)/i, (msg) ->
msg.send "No, I love it!"
You can’t perform that action at this time.