Google Blogoscoped

Forum

Screen-scraping Current Google Images  (View post)

Veky [PersonRank 10]

Monday, March 19, 2007
17 years ago4,945 views

I think Zoran will kill you for this, Philipp. ;-D

Michael Martinez [PersonRank 5]

17 years ago #

But...but...Google doesn't WANT us to scrape, do they?

pokemo [PersonRank 10]

17 years ago #

tried but it returns an error
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/combine/public_html/sex.php5 on line 16

Philipp, any idea?

Philipp Lenssen [PersonRank 10]

17 years ago #

Ouch. Something killed the backslashes in the post. I updated the source again.

pokemo [PersonRank 10]

17 years ago #

Thanks Philipp, it works fine now!!!

martin english [PersonRank 1]

17 years ago #

my host has disabled file_get_contents for url's. I got round it by using curl. The code below should REPLACE the line containing file_get_contents.
<code>
//
// file_get_contents is disabled – must use curl
// $result = file_get_contents($url);
$ch = curl_init($url);
$handle = fopen("page1.txt", "w");

curl_setopt($ch, CURLOPT_FILE, $handle);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);
curl_close($ch);
fclose($handle);

$handle = fopen("page1.txt", "r");
$result = '';
while (!feof($handle)) {
$result .= fread($handle, 8192);
}
fclose($handle);
// $result = file_get_contents($url);
// file_get_contents is disabled – must use curl
</code>

martin english [PersonRank 1]

17 years ago #

FYA: http://www.martin-english.com/display_code.php?path=/php/google_image.php
(it also includes the update referred to in http://blogoscoped.com/forum/89342.html#id89399)

Philipp Lenssen [PersonRank 10]

17 years ago #

Martin, I had the same problem here for a long period of time (with Schlund/ 1&1), and also used your workaround to replace file_get_contents. These days they support file_get_contents again :)

Forum home

Advertisement

 
Blog  |  Forum     more >> Archive | Feed | Google's blogs | About
Advertisement

 

This site unofficially covers Google™ and more with some rights reserved. Join our forum!