screenhook is a script that captures an image of a web page and send it to a discord webhook.
sudo apt update && sudo apt upgrade
sudo apt install chromium-chromedriver
curl -fsSl https://raw.githubusercontent.com/ToastEnergy/screenhook/master/install.sh | sh
cd screenhook
python3 screenhook.py
when you run the script for the first time you will be prompted to enter some configuration.
later you will be able to edit the configuration file (config.json
) that has been created with the following options:
-
WEBSITE_URL
: the website to target (include http protocol) -
WEBHOOK_URL
: the discord webhook url that will look something like this:https://discordapp.com/api/webhooks/0123456789/abcdefghijklmnopqrstuvwxyz
-
WAIT_BEFORE_SCREENSHOT
: the amount of time to wait before taking the screenshot (in seconds) -
WORK_WITH_ERRORS
: if set tofalse
the script won't take the screenshot if the website returns an error (default:true
)
{
"WEBSITE_URL": "https://google.com",
"WEBHOOK_URL": "https://discordapp.com/api/webhooks/0123456789/abcdefghijklmnopqrstuvwxyz",
"WAIT_BEFORE_SCREENSHOT": 5
}
sudo apt update
sudo apt install cron
crontab -e
after creating the config file by running the program at least once paste this at the end of the crontab file: @weekly /bin/python3 /home/user/screenhook/screenhook.py
Other examples | Description |
---|---|
0 * * * * /bin/python3 /home/user/screenhook/screenhook.py | run the command every hour |
@daily /bin/python3 /home/user/screenhook/screenhook.py | run the command every day |
00 14 * * sat /bin/python3 /home/user/screenhook/screenhook.py | run the command every Saturday at 14:00 |
@reboot /bin/python3 /home/user/screenhook/screenhook.py | run the command every reboot |
You can find more examples on crontab guru