Google Blogoscoped

Forum

Screen-scraping Current Google Images  (View post)

Veky [PersonRank 10]

Monday, March 19, 2007
13 years ago4,210 views

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

Michael Martinez [PersonRank 5]

13 years ago #

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

pokemo [PersonRank 10]

13 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]

13 years ago #

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

pokemo [PersonRank 10]

13 years ago #

Thanks Philipp, it works fine now!!!

martin english [PersonRank 1]

13 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]

13 years ago #

FYA: martin-english.com/display_cod ...
(it also includes the update referred to in [Up] blogoscoped.com/forum/89342.ht ...)

Philipp Lenssen [PersonRank 10]

13 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 :)

This thread is locked as it's old... but you can create a new thread in the forum. 

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!