1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:31 +02:00
dockerfiles/urlwatch
Tevin a14b830b8b
Add beautifulsoup4 as a dependency
So using filters like `beautify` won't result in the following error:

```
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/urlwatch/handler.py", line 120, in process
    data = FilterBase.process(filter_kind, subfilter, self, data)
  File "/usr/lib/python3.8/site-packages/urlwatch/filters.py", line 180, in process
    return filtercls(state.job, state).filter(data, subfilter)
  File "/usr/lib/python3.8/site-packages/urlwatch/filters.py", line 276, in filter
    raise ImportError('Please install BeautifulSoup')
ImportError: Please install BeautifulSoup
```
2021-04-08 22:53:02 +08:00
..
data Document how to override cron schedule 2021-01-19 19:51:16 -05:00
docker-compose.yml Document how to override cron schedule 2021-01-19 19:51:16 -05:00
Dockerfile Add beautifulsoup4 as a dependency 2021-04-08 22:53:02 +08:00
README.md update urlwatch 2021-01-22 18:05:46 +08:00

urlwatch

urlwatch is a tool for monitoring webpages for updates.

docker-compose.yml

urlwatch:
  image: vimagick/urlwatch
  volumes:
    - ./data:/root/.urlwatch
  restart: unless-stopped

urls.yaml

---

url: "https://github.com/thp/urlwatch/releases/latest"
filter:
- xpath: '(//div[contains(@class,"release-timeline-tags")]//h4)[1]/a'
- html2text: re

---

url: "https://github.com/shadowsocks/shadowsocks-libev/releases/latest"
filter:
- css: 'div.f1>a'
- html2text: re

...

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.2.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

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