Automated news digests from various Zambian πΏπ² sources.
- Introduction
- Project Evolution: From Podcast to News Digest
- Development
- Deployment
- Contributing
- TODO
- Credits
This tool gathers news from various Zambian πΏπ² sources, processes them, and presents them as a text-based news digest.
The project has two main components:
-
core -- A Python application that handles:
- Gathering news from RSS feeds using requests, feedparser, and beautifulsoup4.
- Processing the news articles using Large Language Models (LLMs).
- Generating structured data for the static website.
-
web -- An 11ty static site that presents the news digests.
After 500 episodes, I decided to transition the Zed News project from generating audio podcast episodes to producing text-based news digests. The core value of providing consolidated Zambian news is still preserved.
The original podcast episodes have been archived, and the project now focuses on delivering fast, scannable news content.
- Clone or fork the project.
cd
into the project directory.
Note
You need to have
docker
anddocker-compose
on your machine.
-
Install Poetry.
-
Create a Python virtual environment.
-
Install dependencies:
poetry install
-
Set up environment variables:
# Copy the example .env file cp -v .env.example .env # Update the values in your new .env file
-
Build and run the Docker containers:
inv up --build
-
Access the
app
container's shell:inv exec app bash
Inside the container, you can run the following commands:
- Run tests:
inv test
- Generate a new digest:
inv digest
See available invoke tasks with invoke -l
.
The project uses pgweb to visualize database changes. Access it at http://127.0.0.1:8081.
This project uses Node.js v18. We recommend using fnm or volta to manage Node.js versions.
- Install frontend dependencies:
npm install
- Start the local development server (accessible at http://127.0.0.1:8080/):
npm start
See other available scripts in package.json
.
The project's final output is a static site, which can be hosted on any platform that supports static files, such as Cloudflare Pages, Netlify, Vercel, or GitHub Pages.
Warning
Ensure that environment variables are updated accordingly for both the core application and the web build process.
For an automated, hands-off setup, follow these steps:
- Set up a nix-based machine (e.g., a VPS or your laptop) with a Python virtual environment,
docker
, anddocker-compose
. - Configure a cron job to run the
cron.sh
script located in the project root. This script automates the generation and deployment process. - Ensure
git
is configured correctly on the machine, as thecron.sh
script pushes the generated content to the repository, which in turn triggers the website's build and deployment pipeline.
Note
The
cron.sh
script uses Apprise to send notifications when a new digest is ready. You will need to configure the notification service (e.g., ntfy.sh) in your.env
file.
This project follows the all-contributors specification. Contributions, issues and feature requests are most welcome! A good place to start is by helping out with the unchecked items in the TODO section of this README!
Feel free to check the issues page and take a look at the contributing guide before you get started.
To maintain code quality and formatting consistency, we utilize pre-commit hooks. These hooks automatically check and format your code before each commit. This helps ensure that the codebase remains clean and consistent throughout the development process. Set up the Git pre-commit hooks by running the following
pre-commit install && pre-commit install --hook-type commit-msg
See pre-commit-config.yaml
for more details. In addition, please note the following:
- if you're making code contributions, please try and write some tests to accompany your code, and ensure that the tests pass. Also, were necessary, update the docs so that they reflect your changes.
- your commit messages should follow the conventions described here. Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug". Once you are done, please create a pull request.
- Improve test coverage
- Create a dynamic
og:image
for each digest. - Keep things DRY. For example, the header and footer icons.
- Improve the mobile UI.
- Improve accessibility (a11y).
- Implement search functionality for the news digests.
- Add weather reports/forecasts
- Add exchange rates feature.
- Consider more sustainable AI integrations
- Add Diamond TV as a news source.
- https://pixabay.com/music/beats-sweet-breeze-167504/
- https://pixabay.com/music/beats-aesthetic-beat-royalty-free-music-215851/
- https://pixabay.com/music/beats-digital-technology-131644/
- https://pixabay.com/music/beats-stellar-echoes-202315/
- https://pixabay.com/music/afrobeat-it-afrobeat-149308/