Image Scraper based on Keywords?

Status
Not open for further replies.

Enigmabomb

New member
Feb 26, 2007
2,035
66
0
Than Franthithco
I'm looking for an image scraper based on keywords. If one doesn't exist, I'm about to start writing it. IT doesn't even need a front end, I can just ref it in my php if neccesary.

Here's the functionality i'm looking for. (Pseudo code)

fetchpics( keyword )
query google images (keyword)
scrape picture( num pictures)
place picture in directory called /pictures / keyword[num picture].jpg
return true

So when it's all done, it returns true, and my pictures dir has (For example let's use fish) fish01.jph fish02.jpg fish03.jpg etc etc etc all the way to num pictures.

Thanks for your suggestions,

Josh
 


Not hard to make AT ALL.

Taking google images as an example....feed it a query string, scrape the results for the URL of every image, and download it with curl (see here).
 
  • Like
Reactions: lucab
This is a little something I'm using to extract images from yahoo based on keywords. Might help you out.. :)

Code:
$tag = "KEYWORD";

$noImageURL = $myurlprefix ."images/notfound.jpg"; //replace with image address


$request =  "http://api.search.yahoo.com/ImageSearchService/V1/imageSearch?appid=YOUR-APP-ID-HERE&query=$tag&results=5&output=php";

@$response = file_get_contents($request);

if ($response != false) {
$phpobj = unserialize($response);


    $ImageBigURL['0'] = $phpobj['ResultSet']['Result']['0']['Url'];
    $ImageBigURL['1'] = $phpobj['ResultSet']['Result']['1']['Url'];


        if ($phpobj['ResultSet']['totalResultsAvailable'] == '0'){
        // IF No Results
            $ImageBigURL['0'] = $noImageURL;
            $ImageBigURL['1'] = $noImageURL;
            
        }

}else{

//If not Found

    $ImageBigURL['0'] = $noImageURL;
    $ImageBigURL['1'] = $noImageURL;
        
}
 
Busin3ss switched to a new server as far as I know, but the YACG forum and his blog are up again and loading fine...just check again.
 
Status
Not open for further replies.