Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Improve success rate of mustachification #335

Merged
merged 1 commit into from

2 participants

@Seldaek

imgtype=face tries to return results that contain human faces making it easier for mustachify to do its job.

@Seldaek Seldaek Improve success rate of mustachification
imgtype=face tries to return results that contain human faces
making it easier for mustachify to do its job.
a9b4e1c
@technicalpickles technicalpickles merged commit 831c5e3 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 18, 2012
  1. @Seldaek

    Improve success rate of mustachification

    Seldaek authored
    imgtype=face tries to return results that contain human faces
    making it easier for mustachify to do its job.
This page is out of date. Refresh to see the latest.
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) ->
Something went wrong with that request. Please try again.