I have been chasing a couple of domain names I want to register for a while now, and these are either registered by someone else, or taken by a broker who wants to have big money for them. Every once in a while I’m checking them (when I think of it) but this will probably leave me empty handed so I thought of an idea to do this automagically and send me a message whenever they are available. Created a little script, added it to cron and tested the notifications.
#!/bin/bash domain=$1 test=$(whois $domain) if [ "$test" = "$domain is free" ]; then /usr/bin/curl -s "https://api.telegram.org/your_bot_id:your_api_key/sendMessage?chat_id=your_chat_idtext=🌎 $domain = free" fi
Ofcourse you can plugin your own notification system or add ‘your_bot_id’, ‘your_api_key’ and your_chat_id in this script.
Add it to the crontab:
@daily /path/to/script/whois2tg.sh thisisfree.nl
It will only send a message when the domain is ‘free’ like so:
Small but handy, thought it was worth sharing …