 twitter_query = (robot) ->
   robot.brain.data.twitter_mention.query ||
     process.env.HUBOT_TWITTER_MENTION_QUERY
-
-sendMessage = (robot, str) ->
-  robot.adapter.send({room: process.env.HUBOT_TWITTER_MENTION_ROOM}, str )


module.exports = (robot) ->
  response = new robot.Response(robot)
  robot.brain.data.twitter_mention ?= {}
  setInterval ->
    last_tweet = robot.brain.data.twitter_mention.last_tweet || ''


          if tweets.results? and tweets.results.length > 0
            robot.brain.data.twitter_mention.last_tweet = tweets.results[0].id_str
            for tweet in tweets.results.reverse()
              message = "http://twitter.com/#!/#{tweet.from_user}/status/#{tweet.id_str}"
              robot.messageRoom room, message
  , 1000 * 60 * 5

  robot.respond /(set twitter query) (.*)/i, (msg) ->
    robot.brain.data.twitter_mention.query = msg.match[2]
