Jump to content

Working with Yahoo API


sloth456

Recommended Posts

All I want to do is find out the number of links pointing to a page using Yahoo's API.

 

I've played around with the request URL but haven't been able to return a result that shows the data I want in it anywhere.

 

If you want to have a go, the info is at http://developer.yahoo.com/search/siteexplorer/V1/inlinkData.html

Link to comment
https://forums.phpfreaks.com/topic/133825-working-with-yahoo-api/
Share on other sites

Hi is this what you meant?

<?php
$website = "http://yahoo.com";
$req = "http://search.yahooapis.com/SiteExplorerService/V1/inlinkData?appid=YahooDemo&output=php&results=1&query=" . $website;
// Make the request
$phpserialized = file_get_contents($req);
// Parse the serialized response
$phparray = unserialize($phpserialized);
echo $phparray[ResultSet][totalResultsAvailable];
?>

You should look at these pages:

http://developer.yahoo.com/search/rest.html

http://developer.yahoo.com/common/phpserial.html

 

Thanks very much, it was very kind of you to take the time out to show me.

 

I did look through those pages and made some code to test it out, but obviously I missed something obvious.

 

Thanks again.

 

Interestingly the number of inlinks returned by the script is slightly different than the number that site explorer returns when you go and input it manually.

 

For http://www.google.com I got 297,789,280 using the script and 297,779,166 through inputting the URL in site explorer manually.

 

Any idea why? I set the search for 'Show Inlinks: From All pages to: Only this URL'

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.