Welcome to WebmasterWorld Guest from 54.163.168.15

Forum Moderators: bill & werty

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

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

5+ Year Member



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?

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

10+ Year Member



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

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

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month