sloth456 Posted November 22, 2008 Share Posted November 22, 2008 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 Quote Link to comment Share on other sites More sharing options...
curt22 Posted November 23, 2008 Share Posted November 23, 2008 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 Quote Link to comment Share on other sites More sharing options...
sloth456 Posted November 23, 2008 Author Share Posted November 23, 2008 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' Quote Link to comment Share on other sites More sharing options...
xtopolis Posted November 23, 2008 Share Posted November 23, 2008 Perhaps the database for the API is a mirror of the actual database that doesn't update right away. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.