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 Link to comment https://forums.phpfreaks.com/topic/133825-working-with-yahoo-api/ 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 Link to comment https://forums.phpfreaks.com/topic/133825-working-with-yahoo-api/#findComment-697132 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' Link to comment https://forums.phpfreaks.com/topic/133825-working-with-yahoo-api/#findComment-697273 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. Link to comment https://forums.phpfreaks.com/topic/133825-working-with-yahoo-api/#findComment-697283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.