Permalink
Browse files

Updated mustachify to generate a psuedorandom mustache.

  • Loading branch information...
1 parent aaf0349 commit 14b9016be7c970369d407fc5bea22c5ed492c992 @DavidWittman DavidWittman committed Dec 1, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/scripts/google-images.coffee
View
4 src/scripts/google-images.coffee
@@ -17,6 +17,8 @@ module.exports = (robot) ->
msg.send url
robot.respond /(?:mo?u)?sta(?:s|c)he?(?: me)? (.*)/i, (msg) ->
+ type = Math.floor(Math.random() * 3)
+ mustachify = "http://mustachify.me/#{type}?src="
imagery = msg.match[1]
if imagery.match /^https?:\/\//i
@@ -25,8 +27,6 @@ module.exports = (robot) ->
imageMe msg, imagery, (url) ->
msg.send "#{mustachify}#{url}"
-mustachify = "http://mustachify.me/?src="
-
imageMe = (msg, query, cb) ->
msg.http('http://ajax.googleapis.com/ajax/services/search/images')
.query(v: "1.0", rsz: '8', q: query)

0 comments on commit 14b9016

Please sign in to comment.