2012-08-22 20:33
浏览 12


I used SimplePie to display RSS feed from a basketball website. The article titles show up but I want the entire article to display. I tried changing

echo $item->get_description() to echo $item->get_content()

it still only shows the little exert. I know it's possible because:


this website displays the entire article just like how I want it. Any suggestions how to do this with SimplePie?

图片转代码服务由CSDN问答提供 功能建议

我使用SimplePie来显示篮球网站的RSS提要。 文章标题显示但我想要显示整篇文章。 我尝试更改

echo $ item-> get_description()以回显$ item-> get_content()

它仍然只显示了一点点 发挥。 我知道这是可能的,因为:

http://fulltextrssfeed.com/ < / p>

这个网站就像我想要的那样显示整篇文章。 有关如何使用SimplePie执行此操作的任何建议吗?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • doufang8965 2012-08-22 20:59

    If an RSS feed does not contain the article, no matter which parser you use you will not be able to extract something from nothing.

    However, what I tend to do is use Diffbot to parse articles. They have an easy-to-use API and as far as I know is the best free article parser.

    So, you would get each URL and make a batch request to Diffbot which will return a large JSON array, which you can then extract the full article from.

    点赞 打赏 评论
  • dounianluo0086 2012-08-22 20:49

    If the feed doesn't contains the full article you will not able to retrieve the content just from the feed. It doesn't matter what library you use to parse the data, parsing it doesn't make left out parts magically appear.

    I'm only guessing since the fulltextrssfeed.com service is not open-source, but i suspect that it crawls the item links, tries to find the part that does in the feed on the webpage and extract everything that looks like the content. You can subscribe on their page to get notified when the developer API is available.

    点赞 打赏 评论

相关推荐 更多相似问题