我使用YQL使用javascript (作为json)检索RSS提要,例如,我使用以下查询:
select * from rss where url = "http://feeds2.feedburner.com/ajaxian"
响应包含提要项,已经被解析为json,到目前为止一切都很酷。
现在,我还想获得整个提要的标题(不是特定项的标题),但它不是结果的一部分(即使原始的XML提要包含它)。
有可能查询原始XML本身。例如:
select channel.title from xml where url = "http://feeds2.feedburner.com
我想将RSS缓存到SQLite数据库中,以提高应用程序的性能。
我只关心RSS提要的基本内容,即title、description、URL guid和pubDate。到目前为止,我可以处理它们并将它们存储到Vector<Feed>中,Feed是我的自定义类。
在这方面,我发现很少有东西能让我感到难以置信,因为我是机器人的新手。
假设我有如下标题的提要项目:
1. Cat Kills the Dog
2. Curosity Killed the Cat in Revenge
3. Y U NO leave Cat alone ?
在第一次运行中,获取表的行计数将返回零,这意味着我
我想要做的是让python遍历所有的RSS提要标题,并让终端只打印包含特定单词的标题。
import feedparser
d = feedparser.parse('http://rss.cnn.com/rss/edition_technology.rss')
print d['feed']['title']
print 'number of entries: '
print len(d['entries'])
for post in d.entries:
print post.title +