PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
roice
Forum Commoner
Posts: 35 Joined: Tue Mar 02, 2010 9:14 am
Post
by roice » Wed Apr 07, 2010 9:56 am
Hello,
The following link will give you the number of the Inbound link to some url:
http://search.yahooapis.com/SiteExplore ... output=xml
In the top you can find "totalResultsAvailable=14370725"
how can I get the number into varibale?
I tried this:
Code: Select all
$resp = file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/inlinkData?appid=YahooDemo&query=http://www.cnn.com&omit_inlinks=domain&output=xml");
$xml = simplexml_load_string($resp);
echo $xml->ResultSet['totalResultsAvailable'];
But its not working...:/
Technocrat
Forum Contributor
Posts: 127 Joined: Thu Oct 20, 2005 7:01 pm
Post
by Technocrat » Wed Apr 07, 2010 10:09 am
You were SO close.
Code: Select all
$resp = file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/inlinkData?appid=YahooDemo&query=http://www.cnn.com&omit_inlinks=domain&output=xml");
$xml = simplexml_load_string($resp);
echo (string)$xml['totalResultsAvailable'];
roice
Forum Commoner
Posts: 35 Joined: Tue Mar 02, 2010 9:14 am
Post
by roice » Thu Apr 08, 2010 2:17 am
Thank you,
It's working.