Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

11 lines (11 sloc) 0.382 kb
#gets tweet from user
module.exports = (robot) ->
robot.respond /(twitter|lasttweet) (.+)$/, (msg) ->
username = msg.match[2]
msg.http("http://api.twitter.com/1/statuses/user_timeline/#{escape(username)}.json?count=1")
.get() (err, res, body) ->
response = JSON.parse body
if response[0]
msg.send response[0]["text"]
else
msg.send "Error"
Jump to Line
Something went wrong with that request. Please try again.