Permalink
Browse files

like an adult and auto-stache

  • Loading branch information...
atmos committed Oct 5, 2011
1 parent 5293c34 commit 59885035e9817cd782fd616c4dbb179f0847e252
Showing with 37 additions and 1 deletion.
  1. +21 −0 src/scripts/adult.coffee
  2. +15 −0 src/scripts/auto-stache.coffee
  3. +1 −1 src/scripts/tweet.coffee
View
@@ -0,0 +1,21 @@
+# Display a hyperbole and a half image if anyone says "like an adult"
+#
+
+images = [
+ "http://1.bp.blogspot.com/_D_Z-D2tzi14/TBpOnhVqyAI/AAAAAAAADFU/8tfM4E_Z4pU/s400/responsibility12(alternate).png",
+ "http://2.bp.blogspot.com/_D_Z-D2tzi14/TBpOglLvLgI/AAAAAAAADFM/I7_IUXh6v1I/s400/responsibility10.png",
+ "http://4.bp.blogspot.com/_D_Z-D2tzi14/TBpOY-GY8TI/AAAAAAAADFE/eboe6ItMldg/s400/responsibility11.png",
+ "http://2.bp.blogspot.com/_D_Z-D2tzi14/TBpOOgiDnVI/AAAAAAAADE8/wLkmIIv-xiY/s400/responsibility13(alternate).png",
+ "http://3.bp.blogspot.com/_D_Z-D2tzi14/TBpa3lAAFQI/AAAAAAAADFs/8IVZ-jzQsLU/s400/responsibility14.png",
+ "http://3.bp.blogspot.com/_D_Z-D2tzi14/TBpoOlpMa_I/AAAAAAAADGU/CfZVMM9MqsU/s400/responsibility102.png",
+ "http://4.bp.blogspot.com/_D_Z-D2tzi14/TBpoVLLDgCI/AAAAAAAADGc/iqux8px_V-s/s400/responsibility12(alternate)2.png",
+ "http://2.bp.blogspot.com/_D_Z-D2tzi14/TBpqGvZ7jVI/AAAAAAAADGk/hDTNttRLLks/s400/responsibility8.png"
+]
+
+module.exports = (robot) ->
+ robot.hear /like an adult/i, (msg) ->
+ msg.send msg.random images
+
+# Be an adult
+# This is Why I'll Never be an Adult:
+# Taken from: http://hyperboleandahalf.blogspot.com/2010/06/this-is-why-ill-never-be-adult.html
@@ -0,0 +1,15 @@
+# Automatically add mustaches to any images it can
+#
+
+module.exports = (robot) ->
+ robot.hear /^(https?:\/\/[^ #]+\.(?:png|jpg|jpeg))(?:[#]\.png)?$/i, (msg) ->
+ src = msg.match[1]
+
+ unless src.match(/^http:\/\/mustachify.me/)
+ msg.http("http://stacheable.herokuapp.com")
+ .query(src: src)
+ .get() (err, res, body) ->
+ img = JSON.parse body
+
+ if img.count > 0
+ msg.send "http://mustachify.me/?src=#{escape img.src}"
View
@@ -1,6 +1,6 @@
# Display a random tweet from twitter about a subject
#
-# hubot github tweet - Returns a link to a tweet about github
+# hubot <keyword> tweet - Returns a link to a tweet about <keyword>
#
module.exports = (robot) ->

0 comments on commit 5988503

Please sign in to comment.