PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
XML_RSS failing to parse stream.

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR
View previous topic :: View next topic  
Author Message
eddie



Joined: 19 Dec 2008
Posts: 1

PostPosted: Fri Dec 19, 2008 9:17 pm    Post subject: XML_RSS failing to parse stream. Reply with quote

Hello,

First off, apologies for not using the PEAR_XML forum, but it seems those posts don't get answered, so I'm hoping this will garner more interest in this forum.

I'm trying to parse the Kotaku feed [1], and it seems to be stripipng the < and >.

The code I'm using looks like this:

Code:

function DisplayFeed($feed, $maxItems=10, $fakeUserAgent=null)
{
    $iniVal = ini_get('user_agent');
    if($fakeUserAgent != null)
        ini_set('user_agent', $fakeUserAgent); //'MSIE 4\.0b2;');

    print("User agent: " . ini_get('user_agent'));

    $rss =& new XML_RSS($feed);
    $rss->parse();

    print_r($rss);

    echo "<div class='rss_feed' id='$feed'><ul>\n";

    $count = 0;

    foreach ($rss->getItems() as $item)
    {
        $count++;
        echo "<div class='title'>";
            echo "<a href=\"" . $item['link'] . "\">" . $item['title'] . "</a>\n";

        if (array_key_exists('description', $item))
        {
            echo "<div class='description'>" . $item['description'] . "</description>";
        }

        echo "</div>";

        if($count > $maxItems)
            break;
    }

    echo "</ul></div>\n";

    ini_set('user_agent', $iniVal);
}

DisplayFeed("http://feeds.gawker.com/kotaku/full", 10, "Wget/1.11.3");


The end result just seems to change things that should look like this:

&lt;p&gt;&lt;object width="506"

And change them to this:

pobject width="506"

Does anyone know what is going on?

Thanks.

-e-



[1] Feed URL: http://feeds.gawker.com/kotaku/full
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement