Skip to content

Monitor software version changes with Huginn

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.

For another project I'm using Leaflet, a JavaScript library for rendering maps in a browser. New versions are released occasionally, and I want to know when it's time to update the project website. Huginn can do that.

 

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: https://github.com/Leaflet/Leaflet/releases/tag/v1.7.1).

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
  • Url: https://github.com/Leaflet/Leaflet/releases/latest
  • Disable redirect follow: False
  • Changes only: True

By disabling "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:

{
  "url": "https://github.com/Leaflet/Leaflet/releases/latest",
  "response_received": true,
  "elapsed_time": 0.5510568432509899,
  "final_url": "https://github.com/Leaflet/Leaflet/releases/tag/v1.7.1",
  "redirected": true,
  "status": "200"
}

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

{
  "instructions": {
    "agent": "{{agent.type}}",
    "version_regexp_data": "{{version}}",
    "version_string": "{{version.1}}"
  },
  "matchers": [
    {
      "path": "{{final_url}}",
      "regexp": ".+tag.(.+)",
      "to": "version"
    }
  ],
  "mode": "merge"
}

The "matchers" will extract everything after "tag/" using a regexp, and store the information in "version". The "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:

{
  "subject": "Leaflet version change: {{version_string}}",
  "expected_receive_period_in_days": "365",
  "content_type": "text/html",
  "body": "<br/>New Leaflet version: {{version_string}}"
}

This creates a short email, with the new version information included.

  • Twitter
  • Bookmark Monitor software version changes with Huginn at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Monitor software version changes with Huginn
  • Bloglines Monitor software version changes with Huginn
  • Technorati Monitor software version changes with Huginn
  • Fark this: Monitor software version changes with Huginn
  • Bookmark Monitor software version changes with Huginn at YahooMyWeb
  • Bookmark Monitor software version changes with Huginn at Furl.net
  • Bookmark Monitor software version changes with Huginn at reddit.com
  • Bookmark Monitor software version changes with Huginn at blinklist.com
  • Bookmark Monitor software version changes with Huginn at Spurl.net
  • Bookmark Monitor software version changes with Huginn at Simpy.com
  • Bookmark Monitor software version changes with Huginn at blogmarks
  • Bookmark Monitor software version changes with Huginn with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Identi.ca

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.
Form options