homepage Welcome to WebmasterWorld Guest from 54.197.108.124
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
Using Magpie: Selecting the RSS Feed Information, (not the individual
I am using Magpie and I just want to parse out the RSS feed information
DrDel




msg:1541821
 2:41 am on Jan 29, 2006 (gmt 0)

I am trying to find a way to print the top information about an RSS file. For instance I am using the following CNET RSS file:

[export.cnet.com...]

You will see the top few lines of the feed are:

<title>CNET News.com</title>
<link>http://news.com.com/</link>
<description>
Tech news and business reports by CNET News.com. Focused on information technology, core topics include computers, hardware, software, networking, and Internet media.
</description>

These are not <item> tags -- this is the top part of the CNET News RSS.

I want to parse this information and insert it into a database so how would I put each <tag> into its own variable $sitetitle, $sitelink, $sitedescription?

I imagine

foreach ($rss->items as $item ) {

doesn't work since these aren't items, how would one do it?

 

rincey




msg:1541822
 12:15 pm on Jan 29, 2006 (gmt 0)

These infos should be in the $rss->channel array, e.g. $rss->channel["title"]. Try

foreach ($rss->channel as $key=>$value) {
echo $key.": ".$value;
}


Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved