本文整理汇总了Python中feed.Feed.get_description方法的典型用法代码示例。如果您正苦于以下问题:Python Feed.get_description方法的具体用法?Python Feed.get_description怎么用?Python Feed.get_description使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed.Feed
的用法示例。
在下文中一共展示了Feed.get_description方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Filter
# 需要导入模块: from feed import Feed [as 别名]
# 或者: from feed.Feed import get_description [as 别名]
utils.setupLogger()
# read and parse filterfiles
wordfilter = Filter()
wordfilter.read_filterlist('./blackwordlist.txt')
wordfilter.read_filterlist(settings.sitename)
# Parse feed
feed = Feed(feedfile)
# For now we use the language without any regional variants
lang = feed.get_lang().split('-')[0]
wordlists = {}
for child in feed:
title = feed.get_title(child)
summary = feed.get_description(child)
content = feed.get_content(child)
link = feed.get_link(child)
gid = feed.get_id(child)
# Check for duplicates
maxcmplvl = 0
wordlist = comparetext.analyse(lang, title, summary, content)
for index, dic in wordlists.items():
t = comparetext.comp(wordlist, dic)
maxcmplvl = max(maxcmplvl, t)
if t > settings.cmp_threshold:
feed.add_crosslink(index, link, title)
logging.warn(_("removing news entry: %(duplicate)s\n\tas duplicate of: %(news)s") %
{'duplicate': title, 'news': feed.get_title(index)})
continue