I have a block of PHP that is talking to my RSS feed and importing it. The problem is, it's decided to return a 500 Internal Server Error and I can't seem to figure out why. I've used this code with a previous feed and it worked perfectly. But with this new feed it breaks. Any ideas?
Thanks in advance!
<?php $doc = new DOMDocument(); $doc->load('http://guiltyfeminist.com/rss'); $cnt=0; foreach ($doc->getElementsByTagName('item') as $node) { $itemRSS = array ( 'maintitle' => $node->getElementsByTagName('title')->item(0)->nodeValue,'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,'enclosure' => $node->getElementsByTagName('enclosure')->item(0)->getAttribute('url'), ); ?><div class="showcontent"><div class="contentleft"><img src="<?php echo $node->getElementsByTagNameNS('http://www.itunes.com/dtds/podcast-1.0.dtd', 'image')->item(0)->getAttribute('href'); ?>"></div><div class="contentright"><h2><a href="<?php echo $itemRSS['link']; ?>"><?php echo $itemRSS['maintitle']; ?></a></h2><p><strong>Duration</strong> <?php echo $node->getElementsByTagNameNS('http://www.itunes.com/dtds/podcast-1.0.dtd', 'duration')->item(0)->nodeValue; ?></p><p><strong>Published</strong> <?php echo $itemRSS['date']; ?></p><audio controls><source src="<?php echo $itemRSS['enclosure']; ?>" type="audio/mpeg"> Your browser does not support the audio element.</audio></div></div><?php $cnt ++; } ?>