Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP not parsing wordpress rss feed
    primarykey
    data
    text
    <p>I have read about a dozen posts on this topic here on SO and all of them refer to the whitespace issue, which I don't have, and feed validator agrees my feed is okay (http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fgearmunk.com%2Fblog%2Ffeed%2F)</p> <p>I am using the following code to parse the rss:</p> <pre><code>&lt;?php $rss = new DOMDocument(); $rss-&gt;load('http:/gearmunk.com/blog/feed/'); $feed = array(); foreach ($rss-&gt;getElementsByTagName('item') as $node) { $item = array ( 'title' =&gt; $node-&gt;getElementsByTagName('title')-&gt;item(0)-&gt;nodeValue, 'desc' =&gt; $node-&gt;getElementsByTagName('description')-&gt;item(0)-&gt;nodeValue, 'link' =&gt; $node-&gt;getElementsByTagName('link')-&gt;item(0)-&gt;nodeValue, 'date' =&gt; $node-&gt;getElementsByTagName('pubDate')-&gt;item(0)-&gt;nodeValue, ); array_push($feed, $item); } $limit = 3; for($x=0;$x&lt;$limit;$x++) { $title = str_replace(' &amp; ', ' &amp;amp; ', $feed[$x]['title']); $link = $feed[$x]['link']; $description = $feed[$x]['desc']; $date = date('l F d, Y', strtotime($feed[$x]['date'])); echo '&lt;p&gt;&lt;strong&gt;&lt;a href="'.$link.'" title="'.$title.'"&gt;'.$title.'&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;'; echo '&lt;small&gt;&lt;em&gt;Posted on '.$date.'&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;'; echo '&lt;p&gt;'.$description.'&lt;/p&gt;'; } ?&gt; </code></pre> <p>but if you look at <a href="http://gearmunk.com/index3.php" rel="nofollow">http://gearmunk.com/index3.php</a> you will see, on the right, it lists 3 bad dates and no rss data. If I put in another feed URL it works fine, and if I put my rss feed into Google reader it works just fine. I'm hoping there is something stupid simple I'm missing. Can someone help?</p> <p>thanks, Erik</p> <p>MORE INFORMATION:</p> <p>I started to focus in on it being a wordpress problem, so I tried some other wordpress RSS feeds. One from CNN works fine (http://religion.blogs.cnn.com/feed/), however, one from BoingBoing (also a WP site) doesn't work: <a href="http://boingboing.net/feed" rel="nofollow">http://boingboing.net/feed</a>.</p> <p>I am not getting the XML Parse error normally associated with the whitespace issue, so I don't think that is it.</p> <p>Erik</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload