[英]Zend Feed: How to get the whole feed from a website
我正在使用Zend Feed从网站获取Feed。 当我运行它时,我只会得到10个最新条目。 有没有办法从网站上获取整个提要? 自开始以来的所有帖子?!
我的代码是
$feed = new Zend_Feed_Atom('http://www.site.net/atom.xml');
echo 'The feed contains ' . $feed->count() . ' entries.' . "\n\n";
foreach ($feed as $entry) {
echo 'Title: ' . $entry->title() . "\n <br/>";
echo 'ID: ' . $entry->id() . "\n <br/>";
echo 'Link: ' . $entry->link() . "\n <br/>";
echo 'Subtitle: ' . $entry->subtitle() . "\n <br/>";
echo 'Author: ' . $entry->author() . "\n <br/>";
echo 'Content: ' . $entry->content() . "\n <br/>";
echo 'Published: ' . $entry->published() . "\n <br/>";
echo 'Summary: ' . $entry->summary() . "\n\n <br /><br /><br />";
}
谢谢!
这取决于该网站是否实际具有可返回所有项目的提要。 可能没有,这听起来像是默认情况下返回了10个最新条目。 您可能会在Feed中提供一些参数,以控制返回多少项目,但这特定于该网站及其Feed。 – drew010
标记为社区Wiki,因为这不是我的答案,但不应仅留在评论中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.