Skip to content

ryankert01/rss-friend

Repository files navigation

RSS Blog Friend: Collects recent posts from your friends' blogs

Usage

Collect RSS post data from my friends' blogs and convert it to out-of-the-box, sort-by-nearest-date JSON data set, like this:

[
  {
    "title": "Download Google font and use it in offline html",
    "link": "https://blog.ryankert.cc/2022/04/18/google-font-offline/",
    "date": "2022-08-24T17:40:53.489Z",
    "author": { "name": "Ryan's Blog", "link": "https://blog.ryankert.cc/" }
  },
  {
    "title": "將其他 blog 的文章連結到 Jeykyll blog",
    "link": "https://titaliu1224.github.io//posts/link_to_other_blog/",
    "date": "2022-08-22T17:47:35.000Z",
    "author": {
      "name": "tita's Blog",
      "link": "https://titsliu1224.github.io/"
    }
  },
]

*having a maximum display posts of 30

Auto Update

at (UTC) 10:00 and 22:00

at (UTC+8) 6:00 and 18:00

How to use it

  1. Fork this repository

  2. install your friends' rss pages into this file (./_data/friends.json), in this format:

[
    {
        "title": "Ryan's Blog",
        "link": "https://blog.ryankert.cc/",
        "feed": "https://blog.ryankert.cc/atom.xml"
    },
    ...
]
  1. Until it generate file sussessfully, it will generate a new branch automatically. Then, you setup your github page to display the branch gh-pages.

It will be display at https://<github-username>.github.io/rss-friend/<file>.

There are three file generated

rss.json       // sorted json year, month, day
sorted.json    // sorted json universal date ex:2022-08-22T17:47:35.000Z
unsort.json    // unsort raw data

Warning You have to manually enable github action, which forked repositories disabled by default.

APIs:

https://ryankert01.github.io/rss-friend/rss.json

https://ryankert01.github.io/rss-friend/sorted.json

https://ryankert01.github.io/rss-friend/unsort.json

Development: (dev)

To install dependencies

pip install -r requirements.txt
pip install -r requirements-dev.txt  # For testing

To generate JSON file

run the script to generate JSON file

python src/main.py

To run tests

Run the unit tests with pytest:

pytest

Run tests with coverage report:

pytest --cov=src --cov-report=html

Project Structure

rss-friend/
├── src/
│   ├── __init__.py
│   ├── main.py              # Main entry point
│   └── rss_aggregator.py    # Core RSS aggregation logic
├── tests/
│   ├── __init__.py
│   └── test_rss_aggregator.py  # Unit tests
├── _data/
│   └── friends.json          # Configuration for RSS feeds
├── requirements.txt          # Production dependencies
├── requirements-dev.txt      # Development dependencies
└── pytest.ini                # Pytest configuration

CI/CD

  • Test Workflow: Runs automatically on pull requests and commits to main/develop branches
  • Deploy Workflow: Runs on push to main branch and scheduled twice daily (10:00 and 22:00 UTC)

About

Github Action tool to generate recent post JSON files from multiple blogs, auto serve GET APIs on Github Page

Topics

Resources

Contributing

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages