Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Can anybody get google image search to work with new update? #111

Open
krazeeKoder opened this issue Apr 6, 2016 · 11 comments
Open

Can anybody get google image search to work with new update? #111

krazeeKoder opened this issue Apr 6, 2016 · 11 comments

Comments

@krazeeKoder
Copy link

Keep getting Error 400 when using my web API key that was working with same code with previous pod version. When I try to use iOS key with bundle identifier that matches my app I get error 403. This http://stackoverflow.com/questions/24212412/google-custom-search-403-error-in-ios indicates that we should be sending our bundle identifier in the header but there is no method with field to enter bundle ID.

@krazeeKoder
Copy link
Author

can you please confirm if I should be using an iOS api key or if I should be using a browser key? The example project seems to work with a browser api key but not with an iOS api key. If it's the case that it's configured to work only with a browse api key than I would like to propose a feature request that allows you to also send your bundle identifier in the GET header which allows you to use the correct key which is the api Key. Thank you.

@dzenbot
Copy link
Owner

dzenbot commented Apr 14, 2016

Google Images used to work on the sample project. I just tried it again, and it doesn't anymore. Getting a 400 error code.
Google Images APIs must have changed, once more. I don't have much time to look at this. If this is a requirement for your project, try fixing the issue and submit a PR.

@krazeeKoder
Copy link
Author

I'll take a look and see what I find... it's not the API that changed though because it was working with that API pre DZNPhotoPickerController update. Thanks either way :)

@krazeeKoder krazeeKoder changed the title has new version been tested with google images? Can anybody get google image search to work with new update? Apr 18, 2016
@ebalassanian
Copy link

I did a little digging and the URL seems correctly formatted. I am actually seeing problems with google own API explorer when I enter values for anything beyond cx, key, query, and searchType.

@ebalassanian
Copy link

ebalassanian commented May 2, 2016

I found two issues: use "start" instead of "page" and use initial value of 1 instead of 0. Also, you can only ask for 10 images at a time. To retrieve more, you have to do multiple queries which count against your query total.

@dzenbot
Copy link
Owner

dzenbot commented May 2, 2016

Yes, the limit is 10. We should add that to the documentation in

#define kGoogleImagesSearchEngineID @"018335320449571565407:tg2a0fkobws" //cx

You cannot paginate them either, so next page at index 2, will returns the exact same 10 images from the previous page. Google Images APIs are now incredibly useless without a subscription.

@dzenbot
Copy link
Owner

dzenbot commented May 2, 2016

So you managed to fix it? Mind submitting a PR @ebalassanian?

@ebalassanian
Copy link

I'm still trying to wrestle it to behaving. But yes, when I get it cleaned up I'll submit a PR... Bing is all kinds of messed up too. I never get MSFT. They are still using MS WORD for their documentation. Ewww!

@dzenbot
Copy link
Owner

dzenbot commented May 2, 2016

Yeah, both of those services are broken: hard to use, requiring complicated auth and old documentation. No wonder why people use less and less these sort of integrations.

@ebalassanian
Copy link

I submitted the fixes for Google. Let me know if you have any issues and I can address them. I was a bit selfish in the coding to make this work for my purposes, but given how clunky these services are, I"m guessing any changes are going to be short lived regardless.

@ebalassanian
Copy link

hold tight.. i had a merge issue. fixing now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants