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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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'); |
Categories: Uncategorized
![[del.icio.us]](http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png)
![[Facebook]](http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png)
![[Google]](http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png)
![[Reddit]](http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png)
![[Slashdot]](http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png)
Thanks for such a nice code snippet. I was looking for this from ages