π² Daily Random xkcd π²
π About
This repository automatically generates a daily random xkcd comic and serves it as an RSS feed. Each day, a new comic is fetched, formatted, and made available for subscription. Users can configure RSS.app to send email notifications whenever a new comic is available in the feed. It also features a fun xkcd-themed 404 error page that showcases a random comic in a playful layout.
π Features
- π Daily random xkcd comic fetching.
- π‘ Generates an RSS feed that updates with new comic details.
- π Tracks seen comics to avoid duplicates via
seen_comics.json
.
- π§ RSS.app email notifications for new comics.
- π¨ Custom xkcd 404 HTML page showcasing a random comic in a unique format.
βοΈ How It Works
- π Daily Trigger: A GitHub Actions workflow is triggered every day at 8:00 AM UTC+3 to run a Python script (
generate_rss.py
).
- π₯ Random Comic Fetch: The script fetches a random comic from the xkcd API, ensuring it hasn't been seen before.
- π XML Generation: Comic details are formatted as XML and saved to
docs/xkcd_feed.xml
.
- ποΈ Seen Comics Tracking: The comics are tracked in
seen_comics.json
to avoid repeats.
- π RSS Hosting: The RSS feed is hosted on GitHub for easy access by RSS.app.
- π§ Email Notifications: RSS.app monitors the feed and sends email alerts when a new comic is available.
- π‘ 404 Page: A Python script generates an xkcd-themed 404 page with a random comic.
π Links
-
π§ 404 HTML Page
A beautifully styled 404 page demonstrating an XKCD comic.
-
π‘ RSS Comic Feed
An RSS feed of random XKCD comics, formatted in XML.
π οΈ Setup Instructions
Note: Make sure to fork and enable GitHub Actions to automate daily comic fetching.
- Fork this repository to your GitHub account.
- Enable GitHub Actions in your forked repository.
- Set up RSS.app:
- Create a new RSS feed alert for the URL
- Configure the email notifications based on your preferences.
- Enjoy daily xkcd emails and check the latest comic each day!
- Access the 404 Page
π Files
generate_rss.py
: Python script to fetch a random xkcd comic, track seen comics, and generate the RSS feed.
generate_html_404_style_xkcd.py
: Python script to generate the random xkcd-themed 404 page.
seen_comics.json
: JSON file that tracks comics to prevent repeats.
docs/rss/xkcd_feed.xml
: RSS feed with the latest comic details.
docs/404/xkcd_404_style.html
: HTML file for the 404 page.
.github/workflows/update_xkcd_rss_feed.yaml
: GitHub Actions workflow to update the RSS feed daily.
.github/workflows/update_html_404.yaml
: GitHub Actions workflow to update the 404 page daily.
π License
This project is licensed under the MIT License. See the LICENSE file for more details.
π Acknowledgements
- Thanks to xkcd for their amazing comics.
- Shoutout to GitHub Actions for making automation easy.
- Thanks to RSS.app for helping automate RSS-to-email services.
π¬ Contact
If you have any questions or suggestions, feel free to open an issue in this repository!