提交 252c04d3 作者: XveLingKun

习近平讲话数据库

上级 4d77c3aa
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
......@@ -61,11 +61,11 @@ def newsdata(art_content_dict,art_type_dict,dic_lables):
del post_dict['tags']
del post_dict['title_pd']
# 发送kafka
# producer = KafkaProducer(bootstrap_servers=['114.115.159.144:9092'], max_request_size=1024 * 1024 * 20)
# kafka_result = producer.send("research_center_fourth",
# json.dumps(post_dict, ensure_ascii=False).encode('utf8'))
#
# print(kafka_result.get(timeout=10))
producer = KafkaProducer(bootstrap_servers=['114.115.159.144:9092'], max_request_size=1024 * 1024 * 20)
kafka_result = producer.send("research_center_fourth",
json.dumps(post_dict, ensure_ascii=False).encode('utf8'))
print(kafka_result.get(timeout=10))
dic_result = {
'success': 'ture',
......@@ -127,9 +127,9 @@ def get_content():
for data_dict in data_list[:1]:
article_id = data_dict['article_id']
print(type(article_id))
# is_article_id = db_storage.find_one({'id': f"1534423014825668610{article_id}"})
# if is_article_id:
# continue
is_article_id = db_storage.find_one({'id': f"1534423014825668610{article_id}"})
if is_article_id:
continue
title = data_dict['title'] # 采集到的标题
pub_time = data_dict['input_date']
current_date = datetime.now()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论