Move to new Google custom search API
The image search API was taken down and gives "Error: API no longer available" when using !image commands. https://stackoverflow.com/questions/34035422/google-image-search-says-api-no-longer-available The issue is described here.
I just pushed a first pass at this in 8d308e8. Not actually tested because I don't have any API keys set up. @chalda can you make a custom search for your API key and test?
Adding a custom search w/API causes an internal server (500) error. Exact line as follows:
treating !image test from <@106092807336280064> as command { error: { code: 500, message: null } }
@Einarin wrote in your changes to the image search plugin...still getting an "undefined" from the bot however. When you added the ability for the console to log the data being returned I was given this: http://i.imgur.com/8ievEVv.png Text output: http://pastebin.com/1HLUxgyQ
I assume that we're looking for ".responseData" which is not a returnable set of information.
Nice @shiburizu!
It looks like this has a totally different JSON structure than the old google images api. .responseData used to be the image URL. Looks like now we want something like:
bot.sendMessage(msg.channel, data.item[0].title + '\n' + data.item[0].link);
I started on this before but then dropped it when it didn't just work. I'll take another look at it.
Fixed. Thanks @shiburizu for all your help on this! 00cba108fd039288089d5c171f2f87c7cba086e3