Scraping Google Images for Fun and Profit


So once in a while I like to release some free code for people to play around with, so here goes. It could be cleaned up a bit to be more efficient, but it gets the job done.  This is a class I wrote in php to scrape images from Google images. It returns an array with the URL to the thumbnail of the image, the URL to the full-size image, and the ALT text of the image as listed in Google Image search. If you can’t figure out what you can do with this, find a new job. This version will scrape the first page of listings - if you’d like you can modify it to scrape multiple pages… but I need to make this atleast a little fun, right?

-Frenchie

Note: A few people have remarked on using file_get_contents() instead of cURL, as well as a few PHP warnings for undefined constant links. My reasoning behind this: The current version that I have fixes all warnings, and uses cURL. I’m not giving that out for free. What you see here is an old version I had that was written at like 3am one night. I see it in the same light as people releasing security exploits to the public and purposely leaving in code errors: don’t give guns to children, give them super-soakers and leave it up to them to make an M-16 out of it.

Link for downloading:
The Dirty Frenchman’s Google Image Scraper

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Fark
  • Reddit
  • StumbleUpon

Tags: ,   Posted in Blackhat, Coding

Leave a Reply