 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
eddie
Joined: 19 Dec 2008 Posts: 1
|
Posted: Fri Dec 19, 2008 9:17 pm Post subject: XML_RSS failing to parse stream. |
|
|
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:
<p><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 |
|
 |
|
|
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
|
|