How to retrive Yahoo Backlinks count with PHP

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
	$url = "$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, '');
	$response = curl_exec($ch);

	$xml = simplexml_load_string($response);
	return $xml -> attributes() -> totalResultsAvailable;

echo get_yahoo_backlinks_count('');

One thought on “How to retrive Yahoo Backlinks count with PHP”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>