webpagemon

command module
v0.0.0-...-f80587b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2020 License: ISC Imports: 6 Imported by: 0

README

webpagemon

👀 monitor a web page for changes

Usage

Compilation

I run this on a Rasperry Pi, to compile for Raspian:

env GOOS=linux GOARCH=arm GOARM=6 go build -o bin/webpagemon main.go
Wrapper script

I use a wrapper script (mine is named is-it-in-stock-yet.sh) to set the environment variables / arguments I need and to call webpagemon:

is-it-in-stock-yet.sh:
#!/bin/bash
set -e

export TWILIO_ACCOUNT_SID=# your Twilio account SID from, www.twilio.com/console
export TWILIO_AUTH_TOKEN=# your Twilio auth Token from, www.twilio.com/console
export TWILIO_SMS_SENDER=# your Twilio phone number, from www.twilio.com/console/phone-numbers
export WPM_URL=# the web page URL to monitor, e.g. https://www.example.com/
export WPM_SELECTOR=# the document query selector to use to detect a change, e.g. "h1"
export WPM_RECIPIENTS=# comma-separated list of recipient phone numbers, who will be sent a text message when webpagemon detects a change, e.g. `+12223334444,+15556667777`

/path/to/webpagemon \
        "${WPM_URL}" \
        "${WPM_SELECTOR}" \
        "${WPM_RECIPIENTS}"
Crontab

I use cron to periodically run my wrapper script (every 5 minutes here):

# m h  dom mon dow   command
*/5 *  *  *    *     /home/pi/bin/is-it-in-stock-yet.sh > /home/pi/logs/webpagemon.log 2>&1

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL