Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

alfieyfc/twro-rss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TWRO 官方網站公告 Line 推播

Quickstart

Clone repo

git clone https://github.com/alfieyfc/twro-rss.git
cd twro-rss/
touch news_record.txt
python main.py

Run with Docker

docker run -v `pwd`/news_record.txt:/data/news_record.txt alfieyfc/twro-rss

Build your own with Docker

You may change Timezone of your workload if that's what you want

# Dockefile
# Change timezone ENV if needed
ENV TZ=Asia/Taipei
docker build -t <IMAGE_NAME>[:TAG] .
docker run -v `pwd`/news_record.txt:/data/news_record.txt IMAGE_NAME:TAG

Set up a crontab

You may want to set up a crontab to check for news to feed every few minutes or so. I'm using Kubernetes CronJob for this. You should adjust to your own needs.

Set up a CronJob with Kubernetes

Edit cronjob.yaml with your Line Notify token:

          - env:
            - name: LINE_TOKEN
              value: __YOUR_TOKEN__

Edit cron schedule to your needs:

  # Every 1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51 and 56th minute past every hour
  schedule: 1/5 * * * * 

Create CronJob

kubectl apply -f cronjob.yaml

Create PV

If directly using the YAML file from this repo, you will have to create your own Persistent Volume and bound pvc/twro-rss-pvc to the PV. See docs for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published