
本项目监测伊朗、以色列与美国之间战争的新闻报道。
您可以使用本仓库完成以下工作:
您可以在此处阅读完整的技术深度分析。简而言之,伊朗媒体监测执行两个工作流。
第一个工作流运行爬虫,从RSS订阅源收集元数据和新闻文章。默认使用Google RSS源,但您可以在rss.py中更改源。
第二个工作流对已收集的文章进行情感分析,并执行增补操作(upsert)。

项目使用MongoDB存储文章。使用Docker创建MongoDB实例。
收集的数据点如下:
{
"collectionDate": str(datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S")),
"processed": False,
"title": article.title,
"author": article.authors,
"publishedAt": str(article.publish_date),
"publisher": publisher,
"language": article.meta_lang,
"sourceUrl":article.source_url,
"summary":article.summary,
"keywords": article.keywords,
"description": article.meta_description,
"bodyText":article.text,
}
运行rss.py以获取RSS源中的最新文章列表。
运行scraper.py以从Google RSS获取URL并抓取文章。
使用sentiment.py对未处理的文章进行情感分析。当文档获得情感评分后,processed字段将被设为True。