Here's a simple script to retrieve the approximate number of backlinks Yahoo has for a site. The function and how to call it follows:
function get_yahoo_backlinks_count($url) {
$appid = ''; // get this from https://developer.apps.yahoo.com/wsregapp/
$url = "http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=$appid&query=site:$url&results=1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.yoursite.com/');
$response = curl_exec($ch);
curl_close($ch);
$xml = simplexml_load_string($response);
return $xml -> attributes() -> totalResultsAvailable;
}
echo get_yahoo_backlinks_count('google.com');
[ad]
Thanks for such a nice code snippet. I was looking for this from ages