This project fetches articles from one or more RSS feeds and lets you send them as a weekly email via Mailchimp. Articles are saved as Markdown files so they can be re‑used for a future website.
- Fetch RSS feeds listed in an environment variable and store them under
_articles/. - Render a newsletter using Jinja2 (or a plain HTML fallback) and send it with the Mailchimp API.
- Python 3
- Dependencies from
requirements.txt
python -m venv venv
source venv/bin/activate # on Windows use `venv\Scripts\activate`
pip install -r requirements.txtCreate a .env file in the repository root with at least the following variables:
# comma-separated list of RSS feed URLs
RSS_FEED_URLS=https://example.com/rss,https://another.example.com/feed
# Mailchimp credentials
MAILCHIMP_API_KEY=your-api-key
MAILCHIMP_SERVER_PREFIX=us1 # e.g. us1, us2
MAILCHIMP_LIST_ID=your-list-id
# email sender details
EMAIL_FROM=you@example.com
EMAIL_FROM_NAME=Your NameIf python-dotenv is installed (it is included in requirements.txt), the scripts will load this file automatically.
You can customize the email template by creating templates/newsletter.html. If it is absent, a simple built‑in template is used.
-
Fetch articles
python scripts/fetch_rss_feeds.py
New articles are written to the
_articles/directory. -
Send the newsletter
python scripts/send_newsletter.py
The latest articles are loaded and emailed using Mailchimp.
-
Build the Jekyll site
First copy the fetched articles into the Jekyll site's
_posts/folder. Use the helper script or create symlinks. The script automatically prefixes each article filename with the date from its front matter so that Jekyll can process it as a dated post:# copy files ./scripts/sync_articles_to_jekyll.sh # or create symlinks instead of copies ./scripts/sync_articles_to_jekyll.sh --link
Then build the static site:
jekyll build -s jekyll -d jekyll/_site
The generated site will be available under
jekyll/_site/.
The repository currently focuses on fetching articles and sending newsletters. Future improvements may include:
- A Jekyll website to publish the collected articles.
- A GitHub Actions workflow to automate fetching and mailing.
A scheduled GitHub Actions workflow automatically fetches articles and sends the newsletter. Configure these repository secrets so the workflow can run:
RSS_FEED_URLSMAILCHIMP_API_KEYMAILCHIMP_SERVER_PREFIXMAILCHIMP_LIST_IDEMAIL_FROMEMAIL_FROM_NAME
This project is licensed under the MIT License.