From cc2f7f4854965e66e1d97933866e39c51b3e0f56 Mon Sep 17 00:00:00 2001 From: kev Date: Thu, 2 May 2019 20:22:32 +0800 Subject: [PATCH] update urlwatch --- urlwatch/Dockerfile | 1 + urlwatch/README.md | 37 ++++++++++++++++++++++++++++++++++++- urlwatch/data/urls.yaml | 19 +++++++++++++++---- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/urlwatch/Dockerfile b/urlwatch/Dockerfile index c4b2a1b..e06ac38 100644 --- a/urlwatch/Dockerfile +++ b/urlwatch/Dockerfile @@ -23,6 +23,7 @@ RUN set -xe \ minidb \ pyyaml \ requests \ + urlwatch \ && apk del build-base \ libffi-dev \ libxml2-dev \ diff --git a/urlwatch/README.md b/urlwatch/README.md index 171c84e..3b4def3 100644 --- a/urlwatch/README.md +++ b/urlwatch/README.md @@ -10,7 +10,42 @@ urlwatch: image: vimagick/urlwatch volumes: - ./data:/root/.urlwatch - restart: always + restart: unless-stopped +``` + +## urls.yaml + +```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 + +```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 +v3.2.5 +>>> exit ``` [1]: https://thp.io/2008/urlwatch/ diff --git a/urlwatch/data/urls.yaml b/urlwatch/data/urls.yaml index 99ea5f5..56699a4 100644 --- a/urlwatch/data/urls.yaml +++ b/urlwatch/data/urls.yaml @@ -1,4 +1,15 @@ -- 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/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 + +...