1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-23 01:39:27 +02:00
dockerfiles/urlwatch
2021-11-12 16:37:20 +08:00
..
data update urlwatch 2021-11-08 10:20:26 +08:00
docker-compose.yml update urlwatch 2021-10-27 18:44:59 +08:00
Dockerfile fix urlwatch lxml.etree (FIX #191) 2021-11-12 16:37:20 +08:00
README.md update urlwatch 2021-11-08 10:20:26 +08:00

urlwatch

urlwatch is a tool for monitoring webpages for updates.

docker-compose.yml

version: "3.8"
services:
  urlwatch:
    image: vimagick/urlwatch
    volumes:
      - ./data:/root/.urlwatch
    environment:
      - EDITOR=/usr/bin/vi
    restart: unless-stopped

urls.yaml

---

name: urlwatch
url: https://github.com/thp/urlwatch/tags
user_visible_url: https://github.com/thp/urlwatch
filter:
- xpath: '(//h4[@data-test-selector="tag-title"]/a)[1]'
- html2text: re
- strip:

---

name: shadowsocks-libev
url: https://api.github.com/repos/shadowsocks/shadowsocks-libev/releases/latest
user_visible_url: https://github.com/shadowsocks/shadowsocks-libev
filter:
- shellpipe: 'jq -r .tag_name'
- strip:

...

up and running

$ docker-compose up -d
$ docker-compose exec urlwatch sh
>>> urlwatch --test-slack
Successfully sent message to Slack
>>> urlwatch --list
1: https://github.com/thp/urlwatch/releases/latest
2: https://github.com/shadowsocks/shadowsocks-libev/releases/latest
>>> urlwatch --test-filter 2
v3.3.5
>>> exit

customizing cron schedule

Create a crontab file

*/30 * * * * cd /root/.urlwatch && urlwatch --urls urls.yaml --config urlwatch.yaml --hooks hooks.py --cache cache.db
*/15 * * * * cd /root/.urlwatch && urlwatch --urls urls-every-15m.yaml --config urlwatch.yaml --hooks hooks.py --cache cache.db

See the crontab manpage for details on format.

Mount the crontab file as a docker volume

version: "3.8"
services:
  urlwatch:
    image: vimagick/urlwatch
    volumes:
      - ./data:/root/.urlwatch
      - ./data/crontab:/etc/crontabs/root
    restart: unless-stopped