Permalink
Browse files

Merge pull request #199 from DavidWittman/patch-1

Updated mustachify to generate a psuedorandom mustache.
  • Loading branch information...
atmos committed Dec 1, 2011
2 parents aaf0349 + 14b9016 commit 57be565a68d1910cb04d81909f8a093c2739a901
Showing with 2 additions and 2 deletions.
  1. +2 −2 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 57be565

Please sign in to comment.