hubot-archive / hubot-google-images

A hubot script that interacts with the Google Images API
126 stars 66 forks source link

Add fallback for Missing Google Search API #31

Closed HaroldPutman closed 8 years ago

HaroldPutman commented 8 years ago

Address #29 by showing a message and a fallback image.

Google Image Search API is not longer available. Please setup up Custom Search Engine API. No api

You can provide a different fallback URL by defining the environment variable HUBOT_GOOGLE_IMAGES_FALLBACK. If you put {q} in the URL it will be replaced by the URL escaped query string. (for example http://placehold.it/480x150?text={q})

davefp commented 8 years ago

:+1: :shipit:

technicalpickles commented 8 years ago

It looks like deprecatedImage gets used in imageMe if the CSE doesn't respond, and it does a msg.send "Daily image quota exceeded, using alternate source.". Might remove that call and just return an error in that case.

HaroldPutman commented 8 years ago

This is really just a temporary notice until we can get CSE plus some fallback like Bing images integrated,