{"id":18206,"date":"2021-04-16T05:56:29","date_gmt":"2021-04-16T05:56:29","guid":{"rendered":"https:\/\/www.wjst.de\/blog\/?p=18206"},"modified":"2021-07-08T18:36:06","modified_gmt":"2021-07-08T18:36:06","slug":"how-to-monitor-any-website-at-any-time-interval-with-telegram-notification-for-free","status":"publish","type":"post","link":"https:\/\/www.wjst.de\/blog\/sciencesurf\/2021\/04\/how-to-monitor-any-website-at-any-time-interval-with-telegram-notification-for-free\/","title":{"rendered":"How to monitor any website. At any time interval. With Telegram notification. For Free."},"content":{"rendered":"<p>These instructions work for OSX Catalina only and are a bit different than the Linux version shown at <a href=\"https:\/\/github.com\/thp\/urlwatch\">urlwatch<\/a>.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\npython3 -m pip install pyyaml minidb requests keyring appdirs lxml cssselect html2text\r\npython3 -m pip install urlwatch\r\nEDITOR=nano\r\nurlwatch --edit\r\n# CTRL+X leave the editor without saving\r\n<\/pre>\n<p>Then edit ~\/Library\/Application Support\/urlwatch\/urls.yaml<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nkind: url\r\nmax_tries: 3\r\nname: Camptoi\r\nurl: https:\/\/www.camptoi.de\r\nfilter:\r\n- element-by-id: product-desc-18713727425\r\n- html2text:\r\n    body_width: 0\r\n    ignore_images: false\r\n    ignore_links: false\r\n    inline_links: false\r\n    method: pyhtml2text\r\n    pad_tables: false\r\n    single_line_break: true\r\n    unicode_snob: true\r\n<\/pre>\n<p>After that we create the <a href=\"https:\/\/core.telegram.org\/bots\">Telegram bot<\/a> by sending<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/newbot\r\n<\/pre>\n<p>to user BotFather and record the &lt;API&gt; from the response.<\/p>\n<p>We also need to send a dummy message to the new bot so we can look up the sender &lt;ID&gt;<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nhttps:\/\/api.telegram.org\/bot&lt;API&gt;\/getUpdates\r\n<\/pre>\n<p>&lt;API&gt; and &lt;ID&gt; are both entered into ~\/Library\/Application Support\/urlwatch\/urlwatch.yaml<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n...\r\n  telegram:\r\n    bot_token: '&lt;API&gt;'\r\n    chat_id: '&lt;ID&gt;'\r\n    enabled: true\r\n---\r\n<\/pre>\n<p>As we have no cron under MacOS we need a parameter file to run <a href=\"http:\/\/launchctrl\">launchd<\/a>. Should be placed at ~\/Library\/LaunchAgents\/com.urlwatch.plist<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\r\n&lt;!DOCTYPE plist PUBLIC &quot;-\/\/Apple\/\/DTD PLIST 1.0\/\/EN&quot; &quot;http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd&quot;&gt;\r\n&lt;plist version=&quot;1.0&quot;&gt;\r\n\t&lt;dict&gt;\r\n\t\t&lt;key&gt;Label&lt;\/key&gt;\r\n\t\t&lt;string&gt;com.urlwatch&lt;\/string&gt;\r\n\t\t&lt;key&gt;Program&lt;\/key&gt;\r\n\t\t&lt;string&gt;\/Users\/wjst\/opt\/anaconda3\/bin\/urlwatch&lt;\/string&gt;\r\n\t\t&lt;key&gt;RunAtLoad&lt;\/key&gt;\r\n        &lt;true\/&gt;\r\n        &lt;key&gt;StartInterval&lt;\/key&gt;\r\n        &lt;integer&gt;9000&lt;\/integer&gt;\r\n        &lt;key&gt;KeepAlive&lt;\/key&gt;\r\n         &lt;true\/&gt;       \r\n\t&lt;\/dict&gt;\r\n&lt;\/plist&gt;\r\n<\/pre>\n<p>Ultimately, the agent is started (or stopped) using<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nlaunchctl load -w  ~\/Library\/LaunchAgents\/com.urlwatch.plist               \r\nlaunchctl unload ~\/Library\/LaunchAgents\/com.urlwatch.plist\r\n<\/pre>\n\n<p>&nbsp;<\/p>\n<div class=\"bottom-note\">\n  <span class=\"mod1\">CC-BY-NC Science Surf , accessed 14.04.2026<\/span>\n <\/div>","protected":false},"excerpt":{"rendered":"<p>These instructions work for OSX Catalina only and are a bit different than the Linux version shown at urlwatch. python3 -m pip install pyyaml minidb requests keyring appdirs lxml cssselect html2text python3 -m pip install urlwatch EDITOR=nano urlwatch &#8211;edit # CTRL+X leave the editor without saving Then edit ~\/Library\/Application Support\/urlwatch\/urls.yaml kind: url max_tries: 3 name: &hellip; <a href=\"https:\/\/www.wjst.de\/blog\/sciencesurf\/2021\/04\/how-to-monitor-any-website-at-any-time-interval-with-telegram-notification-for-free\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to monitor any website. At any time interval. With Telegram notification. For Free.<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[3195,3635,3327],"class_list":["post-18206","post","type-post","status-publish","format-standard","hentry","category-computer-software","tag-telegram","tag-monitor","tag-website"],"_links":{"self":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/18206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/comments?post=18206"}],"version-history":[{"count":17,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/18206\/revisions"}],"predecessor-version":[{"id":18484,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/18206\/revisions\/18484"}],"wp:attachment":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/media?parent=18206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/categories?post=18206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/tags?post=18206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}