forked from hubot-archive/hubot-shipit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shipit.coffee
45 lines (41 loc) · 1.61 KB
/
shipit.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Description:
# Rodent Motivation
#
# Set the environment variable HUBOT_SHIP_EXTRA_SQUIRRELS (to anything)
# for additional motivation
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_SHIP_EXTRA_SQUIRRELS
#
# Commands:
# ship it - Display a motivation squirrel
#
# Author:
# maddox
squirrels = [
"http://shipitsquirrel.github.io/images/ship%20it%20squirrel.png",
"http://images.cheezburger.com/completestore/2011/11/2/aa83c0c4-2123-4bd3-8097-966c9461b30c.jpg",
"http://images.cheezburger.com/completestore/2011/11/2/46e81db3-bead-4e2e-a157-8edd0339192f.jpg",
"http://28.media.tumblr.com/tumblr_lybw63nzPp1r5bvcto1_500.jpg",
"http://i.imgur.com/DPVM1.png",
"http://d2f8dzk2mhcqts.cloudfront.net/0772_PEW_Roundup/09_Squirrel.jpg",
"http://www.cybersalt.org/images/funnypictures/s/supersquirrel.jpg",
"http://www.zmescience.com/wp-content/uploads/2010/09/squirrel.jpg",
"http://img70.imageshack.us/img70/4853/cutesquirrels27rn9.jpg",
"http://img70.imageshack.us/img70/9615/cutesquirrels15ac7.jpg",
"https://dl.dropboxusercontent.com/u/602885/github/sniper-squirrel.jpg",
"http://1.bp.blogspot.com/_v0neUj-VDa4/TFBEbqFQcII/AAAAAAAAFBU/E8kPNmF1h1E/s640/squirrelbacca-thumb.jpg",
"https://dl.dropboxusercontent.com/u/602885/github/soldier-squirrel.jpg",
"https://dl.dropboxusercontent.com/u/602885/github/squirrelmobster.jpeg",
]
module.exports = (robot) ->
# Enable a looser regex if environment variable is set
if process.env.HUBOT_SHIP_EXTRA_SQUIRRELS
regex = /\bship(ping|z|s|ped)?\s*it\b/i
else
regex = /\bship\s*it\b/i
robot.hear regex, (msg) ->
msg.send msg.random squirrels