Blog Post #1

Open
opened 2020-05-29 17:22:02 +00:00 by sbrl · 1 comment
Owner

Website change detection with headless Firefox and ImageMagick

Have you ever wanted to know when a web page changes? If it does change, it's almost impossible to tell where on the page it's changed. Recently, I was thinking about the problem, and realised a few things:

  • Firefox can be operated headlessly (with --headless) to take screenshots
  • ImageMagick must be advanced enough to diff images

With this in mind, I set about implementing a script. Before we continue, here's an example diff image:

The bits that have changed appear in red. The script I've written also generates an animated PNG showing the difference too:

Pretty cool!

<!-- Release on | 31st May 2020 at 9:00am Author | Starbeamrainbowlabs Tags | Bash, Linux, Terminal, Web, Automation --> Website change detection with headless Firefox and ImageMagick -------------------------------------------------------------- Have you ever wanted to know when a web page changes? If it does change, it's almost impossible to tell _where_ on the page it's changed. Recently, I was thinking about the problem, and realised a few things: - [Firefox](https://firefox.com/) can be operated headlessly (with `--headless`) to take screenshots - [ImageMagick](https://imagemagick.org/) must be advanced enough to diff images With this in mind, I set about implementing a script. Before we continue, here's an example diff image: The bits that have changed appear in red. The script I've written also generates an [animated PNG](https://starbeamrainbowlabs.com/blog/article.php?article=posts/341-APNG-For-All.html) showing the difference too: Pretty cool!
Author
Owner

We should finish this up, but we need a website to change so we can demo it!

We should finish this up, but we need a website to change so we can demo it!
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sbrl/url-diff#1
No description provided.