本文整理汇总了Python中feed.Feed.remove_item方法的典型用法代码示例。如果您正苦于以下问题:Python Feed.remove_item方法的具体用法?Python Feed.remove_item怎么用?Python Feed.remove_item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feed.Feed
的用法示例。
在下文中一共展示了Feed.remove_item方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: max
# 需要导入模块: from feed import Feed [as 别名]
# 或者: from feed.Feed import remove_item [as 别名]
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
if maxcmplvl > settings.cmp_threshold:
feed.remove_item(child)
continue
else:
wordlists[gid] = wordlist
# Check against blackwords
lvl = wordfilter.check(title, settings.title_scale)
if content != "":
lvl += wordfilter.check(content, 1)
elif summary != "":
lvl += wordfilter.check(summary, 1)
if lvl > settings.threshold:
logging.warn(_("removing item %(title)s with score %(score)i") %
{'title': title, 'score': lvl})
feed.remove_item(child)
del wordlists[gid]