Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (23 sloc) 0.536 kB
# Description:
# None
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot cheerlights - get last color from http://www.cheerlights.com
#
# Author:
# marciotoshio
module.exports = (robot) ->
robot.respond /cheerlights/i, (msg) ->
msg.http("http://api.thingspeak.com/channels/1417/field/1/last.json")
.get() (err, res, body) ->
response = JSON.parse body
if response
msg.send "The last color is: " + response["field1"]
else
msg.send "Error"
Jump to Line
Something went wrong with that request. Please try again.