What's New Pussycat?

Charly's Column – urlwatch

Article from Issue 230/2020
Author(s):

Experienced system administrators attach great importance to always being up to date when it comes to information technology. Urlwatch is a command-line tool that presents the latest news from websites that do not offer RSS feeds by email.

Some years ago, I reported on the Miniflux RSS feed aggregator [1] in this column, and I still use it. Miniflux is lean, fast, and easy to use. The media have been predicting the death of RSS feeds for what feels like an eternity, but it still has not happened. However, some websites simply don't offer feeds. I have to do something different here. What I need is a tool that alerts me when a particular website changes.

That's far more complicated than it sounds at first. Using a web service for this purpose (there are countless numbers of them) is out of the question for reasons of data economy. However, the biggest problem is something else. Things on websites that I don't find relevant are constantly changing. For example, a daily newspaper that I regularly read displays job ads that change with every reload. If I was notified every time, it would drive me crazy. There has to be a better way – and there is: urlwatch.

Written in Python 3, urlwatch is included in most popular distributions. If you want to know exactly if and which version of urlwatch is available in your favorite distro, you can find out on Repology.org [2]; DIY enthusiasts can use GitHub [3]. For example, I instructed urlwatch to keep an eye on the online news page for Linux Magazine (Listing 1) – pointlessly, because it actually still offers RSS.

Listing 1

Monitoring Websites

01 $ urlwatch --add url=http://www.linux-magazine.com/Online/News,name=LinMag

In my home directory below .config/urlwatch/, urlwatch has now created a configuration file named urls.yaml (Listing 2). So far, so good – but I want to be sure that I am only notified when a new news ticker post is published. I want urlwatch to ignore any other changes to the website.

Listing 2

urls.yaml

01 kind: url
02 name: LinMag
03 url: http://www.linux-magazine.com/Online/News

To do this, I briefly immersed myself in the website's HTML source code and discovered that every news ticker entry is introduced by a div tag that contains the specification "td_module_9 td_module_wrap" as its class specification. This prompted me to append the following line to the configuration in urls.yaml:

filter: element-by-id:td_module_9

Now urlwatch only alerts me when a new ticker entry appears on the website. There is a rich selection of alerting types; I opted for plain old email. All I have to do is enter the appropriate mail server, as well as the sender and recipient addresses, below .config/urlwatch/ in the urlwatch.yaml configuration file's report section. And, lo and behold, the electronic mailman was soon ringing the bell (Figure 1).

Figure 1: Urlwatch immediately notifies Charly by email when news is posted on his favorite websites.

Infos

  1. "The Sys Admin's Daily Grind: Miniflux" by Charly Kühnast, Linux Magazine, issue 164, July 2014, http://www.linux-magazine.com/Issues/2014/164/Charly-s-Column-Miniflux/(language)/eng-US
  2. urlwatch packages: https://repology.org/project/urlwatch/versions
  3. urlwatch on GitHub: https://github.com/thp/urlwatch

The Author

Charly Kühnast manages Unix systems in a data center in the Lower Rhine region of Germany. His responsibilities include ensuring the security and availability of firewalls and the DMZ.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Charly's Column: Miniflux

    Sys admin Charly Kühnast typically follows 40 to 50 RSS feeds using Tiny Tiny RSS on his own server. Now, the good times spent with the faithful Tiny are coming to an end. Read on to discover the whole story.

  • News Ticker

    Instead of websites or newsfeeds, Charly prefers to use getnews.tech at the command line to keep up to date with what's happening around the world quickly and in a targeted way.

  • Charly's Column – Zint

    Doing a hardware inventory in a data center is anything but a piece of cake. In order to quickly assign devices to the appropriate database entry, Charly provides each newly acquired system with a QR code sticker with the help of Zint.

  • The sys admin's daily grind: rss2email

    In order to keep up to date with security, Charly uses RSS feeds, among other things. He lets rss2email send the most important feeds directly to his mailbox to ensure that nothing is overlooked.

  • Miniflux: No-frills RSS aggregator
comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News