From b2396acdea387ca0df9adf71338872b171d69440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20=C5=81uczak?= Date: Wed, 31 Jul 2024 19:19:55 +0200 Subject: [PATCH] Update README --- README.md | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 92 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6bb7e38..9401a65 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,102 @@ Monitor YouTube channels using **RSS feeds**, and add new videos to a **collection in Raindrop.io**. The application runs in a loop, checking for new videos every X minutes (frequency). -Each run will add new videos uploaded since the last run (the cache file contains video IDs from the previous run). +Each run will add new videos uploaded since the last run +(the cache file contains video IDs from the previous run). -## Usage +## ๐ŸŽ Features + +- Monitor multiple YouTube channels +- Add new videos to a Raindrop.io collection +- Configurable check frequency +- Caching of previously processed videos + +## ๐Ÿ“ Prerequisites + +- Docker +- Docker Compose +- [Bun](https://bun.sh/) (JavaScript runtime; drop-in replacement for Node.js) +- [Raindrop.io](https://raindrop.io/) account + +## ๐Ÿ› ๏ธ Installation + +1. Clone the repository: + +```shell +git clone https://github.com/thevops/youtube-tracker +cd youtube-tracker +``` + +2. Copy the configuration template and edit it: ```shell cp config/_template.yaml config/production.yaml -# Edit config/production.yaml +# Edit config/production.yaml with your preferred settings +``` + +3. Build and start the application using Docker Compose: + +```shell docker compose build docker compose up -d ``` + +> [!NOTE] +> Public image is available at https://hub.docker.com/r/thevops/youtube-tracker + +## ๐Ÿงพ Configuration + +The configuration file is located at `config/production.yaml`. Here is an example configuration: + +```yaml +log_level: info +frequency: 30 # minutes +raindrop_token: "your_raindrop_token" +raindrop_collection_id: "your_collection_id" +cache_file_path: "/data/cache.json" +feeds: + - name: DevOpsToolkit + channel_id: UCfz8x0lVzJpb_dgWm9kPVrw + - name: Mateusz Chrobok + channel_id: UCTTZqMWBvLsUYqYwKTdjvkw + # Add more channels as needed +``` + +## ๐Ÿงช Development + +To start the application for local development: + +```shell +bun src/index.ts config/production.yaml +``` + +To run a single script: + +```shell +bun +``` + +[./src/youtube.ts](./src/youtube.ts) file can be executed separately +to test the YouTube functionality. +When running the script in this way, the configuration file is not required. +For more details, see the script's `if (import.meta.main) {}` block. + +## ๐Ÿ“ฆ Building the Docker Image + +To build the Docker image: + +```shell +docker buildx build --platform linux/arm64 -t local/youtube-tracker . +``` + +## ๐Ÿงฝ Formatting Code + +To format the code using Prettier: + +```shell +bun x prettier --write . +``` + +## License + +This project is licensed under the MIT License.