Skip to content

Instantly share code, notes, and snippets.

@iainurquhart
Created March 14, 2014 11:23
Show Gist options
  • Save iainurquhart/9545974 to your computer and use it in GitHub Desktop.
Save iainurquhart/9545974 to your computer and use it in GitHub Desktop.
# Description:
# Shows an image the specified Goonie somewhere.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# slackbot showme @joelbradbury with hobbits
# slackbot showme @stephen in cathedral cove
#
# Author:
# iain
module.exports = (robot) ->
robot.respond /showme @?([\w .\-_]+) (with|in) (["'\w: \-_]+)[.!]*$/i, (msg) ->
name = msg.match[1].trim()
searchString = msg.match[2].trim()
q = mark: name, term: searchString
msg.http('http://hubot.iain.co.nz/')
.query(q)
.get() (err, res, body) ->
msg.send body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment