Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (19 sloc) 496 Bytes
# Description:
# Detect tweet URL and send tweet content
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
#
# Author:
# Vrtak-CZ
module.exports = (robot) ->
robot.hear /https?:\/\/(mobile\.)?twitter\.com\/.*?\/status\/([0-9]+)/i, (msg) ->
msg.http("https://api.twitter.com/1/statuses/show/#{msg.match[2]}.json").get() (err, res, body) ->
return if err or (res.statusCode != 200)
tweet = JSON.parse(body)
msg.send "@#{tweet.user.screen_name}: #{tweet.text}"
Jump to Line
Something went wrong with that request. Please try again.