2015-07-07 15:44:11 +08:00
|
|
|
urlwatch
|
|
|
|
========
|
|
|
|
|
2022-02-09 16:17:45 +08:00
|
|
|
> ⚠️ THIS PROJECT WAS MOVED TO: https://github.com/EasyPi/docker-urlwatch
|
|
|
|
|
2015-07-07 17:06:08 +08:00
|
|
|
[urlwatch][1] is a tool for monitoring webpages for updates.
|
|
|
|
|
2015-07-07 16:04:30 +08:00
|
|
|
## docker-compose.yml
|
|
|
|
|
2019-05-02 19:34:00 +08:00
|
|
|
```yaml
|
2021-10-25 12:08:10 +08:00
|
|
|
version: "3.8"
|
|
|
|
services:
|
|
|
|
urlwatch:
|
|
|
|
image: vimagick/urlwatch
|
|
|
|
volumes:
|
|
|
|
- ./data:/root/.urlwatch
|
2021-10-27 18:44:59 +08:00
|
|
|
environment:
|
|
|
|
- EDITOR=/usr/bin/vi
|
2021-10-25 12:08:10 +08:00
|
|
|
restart: unless-stopped
|
2019-05-02 20:22:32 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
## urls.yaml
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
---
|
|
|
|
|
2021-10-25 12:08:10 +08:00
|
|
|
name: urlwatch
|
2021-10-27 18:44:59 +08:00
|
|
|
url: https://github.com/thp/urlwatch/tags
|
2021-11-08 10:20:26 +08:00
|
|
|
user_visible_url: https://github.com/thp/urlwatch
|
2019-05-02 20:22:32 +08:00
|
|
|
filter:
|
2021-10-25 12:08:10 +08:00
|
|
|
- xpath: '(//h4[@data-test-selector="tag-title"]/a)[1]'
|
2019-05-02 20:22:32 +08:00
|
|
|
- html2text: re
|
2021-10-25 12:08:10 +08:00
|
|
|
- strip:
|
2019-05-02 20:22:32 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2021-10-25 12:08:10 +08:00
|
|
|
name: shadowsocks-libev
|
2021-10-27 18:44:59 +08:00
|
|
|
url: https://api.github.com/repos/shadowsocks/shadowsocks-libev/releases/latest
|
2021-11-08 10:20:26 +08:00
|
|
|
user_visible_url: https://github.com/shadowsocks/shadowsocks-libev
|
2019-05-02 20:22:32 +08:00
|
|
|
filter:
|
2021-10-27 18:44:59 +08:00
|
|
|
- shellpipe: 'jq -r .tag_name'
|
|
|
|
- strip:
|
2019-05-02 20:22:32 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
|
|
|
## up and running
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ 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
|
2021-10-25 12:08:10 +08:00
|
|
|
v3.3.5
|
2019-05-02 20:22:32 +08:00
|
|
|
>>> exit
|
2015-07-07 16:04:30 +08:00
|
|
|
```
|
|
|
|
|
2019-05-02 19:34:00 +08:00
|
|
|
[1]: https://thp.io/2008/urlwatch/
|
2021-01-19 19:51:16 -05:00
|
|
|
|
|
|
|
## 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](https://man7.org/linux/man-pages/man5/crontab.5.html#DESCRIPTION).
|
|
|
|
|
|
|
|
### Mount the crontab file as a docker volume
|
|
|
|
|
|
|
|
```yaml
|
2021-10-25 12:08:10 +08:00
|
|
|
version: "3.8"
|
|
|
|
services:
|
|
|
|
urlwatch:
|
|
|
|
image: vimagick/urlwatch
|
|
|
|
volumes:
|
|
|
|
- ./data:/root/.urlwatch
|
|
|
|
- ./data/crontab:/etc/crontabs/root
|
|
|
|
restart: unless-stopped
|
2021-01-22 18:05:46 +08:00
|
|
|
```
|