Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #335 from Seldaek/patch-2

Improve success rate of mustachification
  • Loading branch information...
commit 831c5e3797d8e882ee3749b2325dfe73bfa3da4e 2 parents dee1ee9 + a9b4e1c
@technicalpickles technicalpickles authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/scripts/google-images.coffee
View
6 src/scripts/google-images.coffee
@@ -24,13 +24,15 @@ module.exports = (robot) ->
if imagery.match /^https?:\/\//i
msg.send "#{mustachify}#{imagery}"
else
- imageMe msg, imagery, (url) ->
+ imageMe msg, imagery, false, true, (url) ->
msg.send "#{mustachify}#{url}"
-imageMe = (msg, query, animated, cb) ->
+imageMe = (msg, query, animated, faces, cb) ->
cb = animated if typeof animated == 'function'
+ cb = faces if typeof faces == 'function'
q = v: '1.0', rsz: '8', q: query, safe: 'active'
q.as_filetype = 'gif' if typeof animated is 'boolean' and animated is true
+ q.imgtype = 'face' if typeof faces is 'boolean' and faces is true
msg.http('http://ajax.googleapis.com/ajax/services/search/images')
.query(q)
.get() (err, res, body) ->
Please sign in to comment.
Something went wrong with that request. Please try again.