Google image search API

113 views
Skip to first unread message

Balázs Szántó

unread,
Sep 25, 2013, 1:54:44 PM9/25/13
to google-ajax...@googlegroups.com

Hello!

I discovered some strange behaviour about the Google image search. I want to find a picture of a cat. I type cat in google images, press enter and I pick this little one:

http://www.freegreatpicture.com/files/157/1562-cute-little-cat.jpg

[I just inserted the link of the original image]. When you try to follow this link at the very first time, it will do two redirects:

  1. Request URL:http://www.freegreatpicture.com/files/157/1562-cute-little-cat.jpg
  2. Request URL:http://www.freegreatpicture.com/1562
  3. Request URL:http://www.freegreatpicture.com/cat/photo-1562

The response to the 3. request content types is text/html. Basically it loads the website where this cute kitty lives. So now the kittens images is cached, if you would try one more time to hit this URL:

http://www.freegreatpicture.com/files/157/1562-cute-little-cat.jpg

It would load the image. Super! But what about when you would try this from a native client app? I mean I would want to download the image and show it in a picture box. It wouldn't load the image and you would have no idea why. It would gave back the text/html content what is not image/jpeg.

My question is, is anyone met with this problem? Any work around that to filter out this kinds of urls?

Jeremy Geerdes

unread,
Sep 25, 2013, 2:13:46 PM9/25/13
to google-ajax...@googlegroups.com
I don't think your problem is with the API. You need to offer the correct http_referer header. That's almost assuredly how the server is redirecting you. So set your referer header to the page's link and see what happens.

jg


--
--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msgid/google-ajax-search-api/2cecee01-5467-48d5-81cc-65e82e438473%40googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-ajax-searc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!
Reply all
Reply to author
Forward
0 new messages