Hey guys,
Im fairly new to PHP but i know the basics. Ive been working with the Steam XML feeds for various reasons and im trying to create a list of friends that show whether they are online/offline, show their profile pic... etc...
To get a persons friends list (using me as an example) is: http://steamcommunity.com/profiles/7.../friends?xml=1
But to get to get more information from the friends you take the steamID from the above XML and take information from their main profile XML feed, i have to do this because the normal profile XML (again as me as an example): http://steamcommunity.com/profiles/7...70734089?xml=1 , only displays 6 friends details at a time.
I hope you under stand but please see my PHP below, the problem im having is that it takes forever to run the loop and certain mobile browsers just wont display the page (timeout). I didnt know whether you guys being the phpfreaks would know of a faster memory efficient way of doing this?
PHP Code:
// set the XML file name as a PHP string
$friendslist = http://steamcommunity.com/profiles/76561197970734089/friends/?xml=1 ;
// load the XML file
$xml = @simplexml_load_file($friendslist) or die (no file loaded) ;
// get the output
$steamID = $xml->steamID ;
echo <h1>Main Profile: . $steamID . </h1>;
// set the loop
foreach ($xml->friends->children() as $friendid) {
echo http://steamcommunity.com/profiles/.$friendid.?xml=1 ;
echo <br />;
$friendget = http://steamcommunity.com/profiles/.$friendid.?xml=1 ;
$friendgot = @simplexml_load_file($friendget) or die (no file loaded) ;
echo $friendgot->steamID ;
echo <br /> ;
}
Hey guys,
Im fairly new to PHP but i know the basics. Ive been working with the Steam XML feeds for various reasons and im trying to create a list of friends that show whether they are online/offline, show their profile pic... etc...
To get a persons friends list (using me as an example) is: http://steamcommunity.com/profiles/7.../friends?xml=1
But to get to get more information from the friends you take the steamID from the above XML and take information from their main profile XML feed, i have to do this because the normal profile XML (again as me as an example): http://steamcommunity.com/profiles/7...70734089?xml=1 , only displays 6 friends details at a time.
I hope you under stand but please see my PHP below, the problem im having is that it takes forever to run the loop and certain mobile browsers just wont display the page (timeout). I didnt know whether you guys being the phpfreaks would know of a faster memory efficient way of doing this?
PHP Code:
// set the XML file name as a PHP string
$friendslist = http://steamcommunity.com/profiles/76561197970734089/friends/?xml=1 ;
// load the XML file
$xml = @simplexml_load_file($friendslist) or die (no file loaded) ;
// get the output
$steamID = $xml->steamID ;
echo <h1>Main Profile: . $steamID . </h1>;
// set the loop
foreach ($xml->friends->children() as $friendid) {
echo http://steamcommunity.com/profiles/.$friendid.?xml=1 ;
echo <br />;
$friendget = http://steamcommunity.com/profiles/.$friendid.?xml=1 ;
$friendgot = @simplexml_load_file($friendget) or die (no file loaded) ;
echo $friendgot->steamID ;
echo <br /> ;
}
|
|
Search Webmaster Help and Solution
Steam Feed and PHP Loop problemsRelated ItemsQuery failed: connection to localhost:3354 failed (errno=111, msg=Connection refused). |
