github/hubot-scripts — pull request #597 by glucero (2012-10-19 19:02:29+00:00)
Title: Sudo for protected Hubot commands and a Yelp plugin to return a random restaurant/business/service

The Yelp plugin requires an API key that you can get at http://www.yelp.com/developers

hubot recommend chinese near boulder

> Panasia Fusion at (rated: 5/5 by 2 people.)
> http://www.yelp.com/biz/panasia-fusion-boulder

The Sudo plugin uses an array of Campfire user IDs for authentication and wraps the robot.respond function call:

Sudo = require('./sudo')
sudoers = [123, 456, 789, '1'] # hubot-shell's user id is the string '1'

module.exports = (robot) ->
sudo = new Sudo(robot, sudoers)

sudo.respond /make me a sandwich/i, (msg) ->
msg.send "Okay #{msg.message.user.name}, I'm making you a sandwich."