CLiown
CLiown

Reputation: 13843

PHP - RSS Duplicate items

I have RSS like this:

<title>Session 1</pubDate>
<category>Blue</category>
<category>Green</category>
<evnet:starttime>Mon, 15 Mar 2010 12:05:00 GMT</evnet:starttime>
<evnet:endtime>Mon, 15 Mar 2010 12:30:00 GMT</evnet:endtime>

Im using Magpie RSS Parser to get the RSS feed:

<?php require_once('magpie/rss_fetch.inc');

$rss = fetch_rss('http://live.visitmix.com/Sessions/RSS');

foreach ($rss->items as $item) { 
    $cat = $item['category'];
    $title = $item['title'];
        echo '<li class="'.$cat.'">'.$title.'</li>';
}


?>

The result is:

<li class="BlueGreen">Title</li>

I require:

<li class="Blue Green">Session 1</li>

Note space between classes

How can I insert a space between the category values?

Upvotes: 0

Views: 199

Answers (1)

John Boker
John Boker

Reputation: 83709

http://firsttube.com/read/MagpieRSS-Bug-Fixed/

This post seems to suggest that it's a bug with magpie and they propose a fix that may help, although probably not a fix in the way you want.

You could probably edit the code further and just concatenate the categories adding a space between them.

Upvotes: 1

Related Questions