本文整理匯總了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]