Commit 7c597ff5 authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

Add tags for news if name is CB

parent 570fabf7
......@@ -49,7 +49,10 @@ class ExaPipeline(object):
article = self.get_article(item['url'])
text = article.text
tags = self.get_tags(article)
self.insert_news(item, tags, text)
news = self.insert_news(item, tags, text)
if spider.name == 'cb':
item['tags'] = article.tags
self.update_ml_data(news, item['tags'])
return item
def insert_news(self, item, tags, text):
......@@ -62,7 +65,7 @@ class ExaPipeline(object):
news = self.db.insert(query, data)
self.add_url_to_block(item['url'])
self.update_ml_data(news, item['tags'])
return news
def check_url(self, url):
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment