Finding number of Yahoo and MSN search results with regex?
Posted: Tue Aug 24, 2004 10:49 am
Hi all,
I'm trying to write a function that'll get the number of results for a particular search on Google, MSN and Yahoo. Google is all sorted and you can check the code below but I cant seem to get it to work for the other two search engines.
If anyone can help me figure it out for the other two it'd be great. Might be a small token of my appreciation for the person(s) who manage to figure it out.
Thanks,
Matt
I'm trying to write a function that'll get the number of results for a particular search on Google, MSN and Yahoo. Google is all sorted and you can check the code below but I cant seem to get it to work for the other two search engines.
Code: Select all
$request = file_get_contents("http://www.google.com/search?q=site:" . $site);
preg_match("/\Results <b>ї0-9,]+<\/b> - <b>ї0-9,]+<\/b> of (about )?<b>(ї0-9,]+)<\/b>/i", $request, $matches);
echo "Saturation: ".$matchesї2]."<br>";Thanks,
Matt