本文整理汇总了Python中feed.Feed.downloadFeed方法的典型用法代码示例。如果您正苦于以下问题:Python Feed.downloadFeed方法的具体用法?Python Feed.downloadFeed怎么用?Python Feed.downloadFeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed.Feed
的用法示例。
在下文中一共展示了Feed.downloadFeed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkFeed
# 需要导入模块: from feed import Feed [as 别名]
# 或者: from feed.Feed import downloadFeed [as 别名]
def checkFeed(args):
if len(args) != 1:
print 'No feed given. Please specify a link to an RSS feed to re-classify.'
return
print 'Existing feed data:'
feedStatus(args)
feed = Feed(url=args[0])
print 'Working with: %s' % feed.url
print 'Attempting to download the feed.'
couldDownload = feed.downloadFeed()
if not couldDownload:
print 'Could not download the feed. Is the URL correct? Is their site up? Is GTWifi working for you right now?'
return
print 'Successfully downloaded the feed.'
print 'Attempting to parse the feed.'
parseError, stats = feed.parseFeed()
if parseError is None:
print 'Successfully parsed the feed.'
print stats
if len(feed.articles) == 0:
print 'No articles parsed. Something is wrong'