simplexml_load_file无法在www.thetechjournal.com上读取rss feed

时间:2013-08-02 00:22:59

标签: wordpress rss simplexml

当我尝试在www.thetechjournal.com上阅读RSS提要时,我什么都没得到。他们使用wordpress来生成rss,所以我认为它与它有关。

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

更新:违规的XML作为图像附加。

offending XLM markup is in this image

2 个答案:

答案 0 :(得分:1)

他们的Feed有错误。检查一下:

$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);

答案 1 :(得分:0)

我来自TTJ团队。当我运行这个Validator时它显示正常,但是因为我们有一些iFrame标记了这些问题。有时候,如果某个帖子有任何奇怪的字符,那么什么使它无效。请指出我们可以研究的任何确切问题。我非常感谢您的关注。

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

相关问题