本文整理汇总了Python中feed.Feed.extract方法的典型用法代码示例。如果您正苦于以下问题:Python Feed.extract方法的具体用法?Python Feed.extract怎么用?Python Feed.extract使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed.Feed
的用法示例。
在下文中一共展示了Feed.extract方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: country_articles
# 需要导入模块: from feed import Feed [as 别名]
# 或者: from feed.Feed import extract [as 别名]
def country_articles(country=None):
from feed import Feed
country=country.encode('ascii', 'ignore')
country=country.replace("Dem.", "Democratic")
country=country.replace("Rep.", "Republic")
country=country.replace("W.", "West")
country=country.replace("Lao PDR", "Laos")
country=country.replace("Bosnia and Herz.", "Bosnia and Herzegovina")
country=country.replace("Eq. Guinea", "Equatorial Guinea")
country=country.replace("Cte d'Ivoire", "Ivory Coast")
country=country.replace("Fr. S. Antarctic Lands", "French Southern and Antarctic Lands")
country=country.replace("Is.", "Islands")
country=country.replace("S. Sudan", "South Sudan")
country=country.replace(" ", "_")
print country
url1="http://api.feedzilla.com/v1/categories/19/articles/search.atom?q="+country+"&count=50"
feed = Feed(url1)
# url2="http://api.feedzilla.com/v1/categories/26/articles/search.atom?q="+country+"&count=10"
# feed.add_feed(url2)
# feed = Feed()
# feed.load()
# feed.filter_country(country)
feed.extract()
return feed.to_json()