chelnov63 Posted August 22, 2008 Share Posted August 22, 2008 hi there..im struggling a bit and not sure how to pull in an rss feed using php and display it in a table: for e.g consider http://blog.myspace.com/blog/rss.cfm?friendID=84825413 how using php should i pull this in... or do i need a third party component or prebuilt classes to parse the XML? thanks in advance..i tried googling and stuff but cant seem to find an answer .. any tips advice would really be appreciated..thanks Link to comment https://forums.phpfreaks.com/topic/120872-pulling-in-an-rss-feed/ Share on other sites More sharing options...
DarkWater Posted August 22, 2008 Share Posted August 22, 2008 Check out the PHP SimpleXML extension, as it makes XML parsing relatively...well...simple. xD P.S: I'm finally back from vacation. Link to comment https://forums.phpfreaks.com/topic/120872-pulling-in-an-rss-feed/#findComment-623055 Share on other sites More sharing options...
chelnov63 Posted August 22, 2008 Author Share Posted August 22, 2008 thanks for your advice... I'm trying this: <?php $source = 'http://blog.myspace.com/blog/rss.cfm?friendID=84825413'; // load as file $sitemap = new SimpleXMLElement($source,null,true); foreach($sitemap as $item) { echo "{$item->title}"; } ?> I expected all the item titles to be displayed but all i get is: Nick Harrison - MySpace Blog Do you have any idea where i am going wrong... thanks for your help mate Link to comment https://forums.phpfreaks.com/topic/120872-pulling-in-an-rss-feed/#findComment-623099 Share on other sites More sharing options...
Naez Posted August 22, 2008 Share Posted August 22, 2008 Check out tutorials on DOMdocument Link to comment https://forums.phpfreaks.com/topic/120872-pulling-in-an-rss-feed/#findComment-623101 Share on other sites More sharing options...
chelnov63 Posted August 22, 2008 Author Share Posted August 22, 2008 thanks i've been trying lol ... got a deadline in half an hour ... if someone could give me just a quick pointer how to retrieve titles then i could do the rest ..cheers!!! Link to comment https://forums.phpfreaks.com/topic/120872-pulling-in-an-rss-feed/#findComment-623104 Share on other sites More sharing options...
chelnov63 Posted August 22, 2008 Author Share Posted August 22, 2008 got it figured no worries: <?php $source = 'http://blog.myspace.com/blog/rss.cfm?friendID=84825413'; // load as file $sitemap = new SimpleXMLElement($source,null,true); // Here we'll put a loop to include each item's title and description foreach ($sitemap->channel->item as $item) { echo "$item->title<br>"; } ?> Link to comment https://forums.phpfreaks.com/topic/120872-pulling-in-an-rss-feed/#findComment-623110 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.