RSS Feed getting cut off

扶醉桌前 提交于 2019-12-25 03:11:39

问题


I'm trying to pull in an RSS feed into my PHP code. When I view the feed with Google Reader, I see several hundred items in the feed. However, when I pull it into my code, I'm only seeing 10.

What is the reason for the difference and how can I pull in the full feed?


回答1:


Since you don't show your code, it is impossible to say with certainty what is wrong. However, you tagged your question as a SimplePie question and SimplePie defaults to 10 items in some places. So, that's likely what is happening.

If you want more items, you need to tell it to show more items. See the Render Options section of the wiki documentation. Note the items option. "The number of items to show (the rest are hidden until “More” is clicked). Defaults to 10."

UPDATE: Your comment reminded me that you're using Google Reader to see what is in the RSS feed. But Google Reader will contain things that are no longer in the feed. Like Google's Feed API, Google Reader caches things for a long time (perhaps forever?) so that the user can look at entries from the deep dark past. But the actual RSS feed will not contain very old items typically, possibly to keep the RSS feed size reasonable so that response is snappy for people processing it.



来源:https://stackoverflow.com/questions/12852255/rss-feed-getting-cut-off

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!