Building a Website Watcher

I recently noticed that I waste a lot of time watching web pages for changes. Well, waste no more. Time to automate this.

The concept is pretty simple: reguarly check a web page for changes, and let me know when something changed.

The first thing we'll need is an app. I've created an app called Watcher, that has 4 fields:

  • Title (single line text field)

  • Value (single line text field) - last recorded value of what we're watching

  • URL (single line text field) - URL of the page we're watching for changes

  • Regex (single line text field) - REGEX expression used to extract the value from the page

The next thing we'll need is a flow to check and update the value we're watching on a page.

Building a Website Watcher

Make sure that the hook event is checked so that you receive notifications when changes are found.

Now, let's add a watcher in Podio. For the sake of the example, let's assume I want to monitor this item at MeMex to find out when it's in stock again:

Building a Website Watcher

Let's head over to the script on the ProcFu site and work out the regex we need. It's always a good idea to start with everything (.*):

Building a Website Watcher

Then find the text we want and the text right before and right after.

In this case, we're looking for "Out of Stock", and in particular the Online Store part:

Building a Website Watcher

A good regex to try would therefore be: Online Store \(Store Info\) ([^\n]+)

And if we try that out, it works beautifully:

Building a Website Watcher

So, now we can create the Watcher item in Podio:

Building a Website Watcher

If we simulate vars in our GF flow, it should show the value it's comparing:

Building a Website Watcher

The last thing we need now is a flow to check every watcher. We'll just use an hourly by-date flow to get a view and trigger our original flow (don't forget to create the view in Podio first):

Building a Website Watcher

When the flow runs, it will update your watchers with the current value:

Building a Website Watcher

And this system will continue to check all your watched web pages every hour for changes.

Helpful Resources

Test your regular expressions:

Regex101Regex101 allows you to create, debug, test and have your expressions explained for PHP, PCRE, Python, Golang and JavaScript. The website also features a community where you can share useful expressions.regex101.com

Get Javascript-rendered pages

PhantomJsCloud API Service - It just works!PhantomJsCloud offers high performance manipulation and rendering of webpages to HTML, PDF, JEPG, or JSON. Simple to use, no-install required.phantomjscloud.com