Huginn is a great piece of software, but the documentation is … a bit sparse. Especially when it comes to details of the agents. I’m going to blog about a couple more more examples in the future.
This needs three agents:
Checking for new versions: Http Status Agent
This agent is used to periodically check the website and see if there is a new released version.
In this case I’m using the GitHub repository as source, and there the
latest link. The
Releases page has a
Latest release link (
https://github.com/Leaflet/Leaflet/releases), which is a redirect to the actual version (currently:
The Huginn agent is configured as follow:
Schedule: pick one, I’m using a weekly time
Keep events: I keep events around for
7 days, for debugging purposes
Disable redirect follow:
Disable redirect follow the agent will follow the redirect, and provide the final link in
final_url. And by enabling
Changes only this agent is only emitting events when something changes - a new version is released.
Formatting the data: Event Formatting Agent
The incoming data from the
Http Status Agent looks like this:
What I need is the version information after
tag/. The Formatting Agent can do that using the
matchers. As source specify the output from the
Http Status Agent above. As Options the following
matchers will extract everything after
tag/ using a regexp, and store the information in
instructions creates new variables using the data from the match.
Notify: Email Agent
As input use the output from the
Event Formatting Agent. I’m using the following options:
This creates a short email, with the new version information included.