Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fallback for Missing Google Search API #31

Merged
merged 2 commits into from
Dec 7, 2015

Conversation

HaroldPutman
Copy link

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})

Harold Putman added 2 commits December 2, 2015 22:47
It can now add the query string to the fallback URL. Also updated the documentation
@davefp
Copy link

davefp commented Dec 5, 2015

👍 :shipit:

@@ -99,37 +100,16 @@ imageMe = (msg, query, animated, faces, cb) ->
.error "(see #{error.extendedHelp})" if error.extendedHelp
) error for error in response.error.errors if response.error?.errors
else
msg.send "Google Image Search API is not longer available. " +
"Please setup up Custom Search Engine API."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linking to documentation on how to set this up would definitely help users.

@technicalpickles
Copy link
Contributor

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
Copy link
Author

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

HaroldPutman pushed a commit that referenced this pull request Dec 7, 2015
Add fallback for Missing Google Search API
@HaroldPutman HaroldPutman merged commit 63b58a4 into hubot-archive:master Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants