Andy Bajka
Andy Bajka

Reputation: 169

simplexml_load_file not working to read rss feed at www.thetechjournal.com

When I try to read the rss feed at www.thetechjournal.com I get nothing. They use wordpress to generate the rss, so I assume it has something to do with that.

<?php
$url = 'http://feeds.thetechjournal.com/TheTechJournal';
$rss = simplexml_load_file($url);
print_r($rss);
?>

UPDATE: The offending XML is attached as an image.

offending XLM markup is in this image

Upvotes: 0

Views: 1064

Answers (2)

Asif2BD
Asif2BD

Reputation: 11

I am from TTJ team. When I do run this Validator it shows fine, but as we have some iFrame is marks those issue. And sometime if some post have any weird char that what makes it invalid. Please point out to me any exact issue that we could look into. I do appreciate your concern.

http://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Ffeeds.thetechjournal.com%2FTheTechJournal

Upvotes: 0

wunderdojo
wunderdojo

Reputation: 1027

Their feed has errors. Check it with this:

$url = 'http://feeds.thetechjournal.com/TheTechJournal';
libxml_use_internal_errors(true);
$sxe = simplexml_load_string($url);
if ($sxe === false) {
echo "Failed loading XML\n";
foreach(libxml_get_errors() as $error) {
    echo "\t", $error->message;
}
}
print_r($rss);

Upvotes: 1

Related Questions