I spent longer on google trying to find something that would give me a list of urls from the google SERPS than it would have taken just to slap something together:
I cant post links, but you need to generate your search url using
h t t p : // google . com / ie
the /ie part is very important.
You can append &num=100 to the url to get 100 results, and &start=100 to get results 100+
Do what you like with it, maybe i will find this on google next time i need it
I cant post links, but you need to generate your search url using
h t t p : // google . com / ie
the /ie part is very important.
You can append &num=100 to the url to get 100 results, and &start=100 to get results 100+
Do what you like with it, maybe i will find this on google next time i need it
Code:
<?
$url = "
h t t p : / / w w w . google . com/ie?q=QUERY&num=100
";
$google_page = file_get_contents(trim($url));
$regex = '/<a title="(.*?)" href=(.*?)>(.*?)<\/a>/i';
preg_match_all($regex,$google_page,$google_links);
echo "<pre>";
//var_dump( $google_links );
foreach ($google_links[2] as $link)
{
echo $link . "\r";
}
echo "</pre>";
?>