
Iran War Media Monitor collects news articles covering the US-Israeli war on Iran and applies sentiment analysis to uncover who supports and opposes the war.

This project monitors news coverage of the war between Iran, Israel, and the United States.
You can use this repository to:
You can read the full technical deep dive here. In summary, Iran Media Monitor executes two workflows.
First workflow runs the scraper that collects meta data and news articles from RSS feeds. The feed is set to Google RSS but you can change feed in rss.py.
Second workflow performs sentiment analysis on collected articles and upserts articles.

The project uses MongoDB to store articles. Use Docker to create an instance of MongoDB.
The following data points are collected:
{
"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,
}
Run rss.py to get a list of the latest articles from RSS feed.
Run scraper.py to get urls from Google RSS and scrape the articles.
Use sentiment.py to perform sentiment analysis on unprocessed articles. The process field is set to True when a document has received a sentiment score.