AI-powered news discovery tool which explores topics via APIs by using Anthropic's Claude model and surfaces the most significant stories in a dashboard.
The app begins with a root keyword and queries both the NewsAPI and GNews APIs concurrently for recent articles. Results are merged and deduplicated by URL. Anthropic's Claude model then analyzes each batch using JSON, determining whether the keyword reveals an emerging trend, suggesting follow-up keywords and flagging important articles. The application also feeds Claude's suggested keywords back into the queue, until the daily search quota is exhausted.
Every run is saved to a timestamped folder inside the output directory, which contains a (1) comprehensive log detailing every search and decision, (2) deduplicated timeline of noteworthy stories and (3) archive of all collected articles. A shared index.json file catalogs all completed runs for the dashboard.
The dashboard provides Results and Analytics tabs for viewing information about and from any combination of runs. The Analytics tab renders 8 D3 visualizations, including cumulative trends, top sources and a word cloud. It can also request an analysis written by Claude of stories deemed to be critical and relevant.
Below are the set up steps and prerequisite software programs needed for this application to run on a Linux machine.
-
Install the above programs
-
Open a terminal
-
Clone this repository:
git clone git@github.com:devbret/anthropic-news-bot.git -
Navigate to the repo's directory:
cd anthropic-news-bot -
Create a virtual environment:
python3 -m venv venv -
Activate your virtual environment:
source venv/bin/activate -
Install the needed dependencies:
pip install -r requirements.txt -
Copy and convert the
.env.templatefile into a.envfile:cp .env.template .env -
Add values to the
.envfile -
Run the script:
python3 app.py -
Launch the dashboard:
python3 serve.py -
Open the dashboard in a browser:
http://localhost:8000/ -
When finished, close the dashboard server:
CTRL + C -
Exit the virtual environment:
deactivate
Below you will find information not covered in the installation and use sections above. Including the abilities this repo is intended to demonstrate. As well as an overview of the license this code is made available with. And a way to contact the maintainer with questions, suggestions and collaboration opportunities.
This project repo is intended to demonstrate an ability to do the following:
-
Discover breaking news by starting from a single root keyword and expanding into related topics suggested by AI
-
Query the
NewsAPIandGNewsAPIs concurrently for every keyword, then merge and deduplicate results -
Use structured JSON to help Claude evaluate each batch of articles for emerging trends and important articles
-
Preserve every run as a timestamped archive containing search logs, deduplicated timeline and all collected articles
This repository is distributed under the MIT License. You are free to use, copy, modify, merge, publish, distribute, sublicense and sell copies of this software, including as part of proprietary or commercial work. The single condition is the copyright and permission notices contained in the LICENSE file must be included with any copy or substantial portion of the software that you redistribute. The software is provided "as is", without warranty of any kind, and the copyright holder is not liable for any claim or damages arising from its use.
If you have any questions or would like to collaborate, please reach out either on GitHub or via my website.
0 comments
log in to comment.