A simple python3 script that sends an e-mail alert and/or Pushover notification if a desired item is on a webpage. Includes a Dockerfile which allows the script to run on a cron schedule inside of its own Docker container.
This tool can look for specific text within a specific CSS element on several webpages and notify you when that text is present.
- docker
- docker-compose
###Pushover.net
- Using a computer, login to your pushover.net (note: this is a paid service) account
- Copy "Your User Key", you will need to paste this into
config.ini
later - Click on "Create an Application/API Token"
- Create a name for the new application and click on "Create Application"
- Copy the "API Token/Key", you will need to paste this into
config.ini
later
- The script is preconfigured to send email from a gmail account
- You will need your account's username and password (an application key might be supported too, it hasn't been tested).
- Rename
config.sample.ini
toconfig.ini
(ex.mv config.sample.ini config.ini
) - Under the
notifications
section, setemail_notify
and/orpushover_notify
toTrue
if using those forms of notification, set the ones you don't plan to use toFalse
- If using email or Pushover, you will need to enter the specifics for those notification methods
- Identify the webpage(s) to scrape
- Use the Inspector feature in a web browser to find the CSS element that the text resides in.
- Modify config.ini file to add in the webpage(s) to scrape, the CSS element to look within, and the keywords to search for within that CSS element.
- Modify the cron schedule within the
cronjobs
file to run the script how often you'd like. By default, the script is configured to run every 5 minutes (crontab.guru is a good tool to help figure this out).
cd
into the directory with the github repo on your machine- Run
docker-compose up -d build
to build the docker image from the Dockerfile and run it in Detached mode