From 9c5d75d5e4dc6986649abe765f8ed4bcdd075405 Mon Sep 17 00:00:00 2001 From: jowj Date: Sun, 19 Jan 2020 17:45:41 -0600 Subject: [PATCH] Add get-domain-status.py script, readme updates. --- get-domain-status.py | 16 ++++++++++++++-- readme.md | 6 ++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/get-domain-status.py b/get-domain-status.py index c206bb4..43bfff6 100644 --- a/get-domain-status.py +++ b/get-domain-status.py @@ -1,4 +1,16 @@ +# right now there is not support for .club. +# this has been released on master, but hasn't been pushed to pypi yet. +# this is fucking stupid, but ok, lets just get it working for .net for now. import whois +import datetime -whois.query('jowj.net') -whois.query('awful.club') +sites_to_check = [ + 'jowj.net', +] + +current_year = datetime.datetime.today().year + +for site in sites_to_check: + expire_year = whois.query(site).expiration_date.year + if expire_year - current_year <= 1: + pass # throw an alert, check into sending email / sending to slack diff --git a/readme.md b/readme.md index 7c8327d..fb01a50 100644 --- a/readme.md +++ b/readme.md @@ -16,6 +16,12 @@ using the whois package, get the status of my domains. send an email under the f - the domain is < 90 days away from expiring - the SSL is < 30 days away from expiring +### todo: +- [ ] wait until the .club tld support is merged in, add my other domains to the list of shit to check +- [ ] add SSL checking to the script +- [ ] add email / slack alerting to the script. +- [ ] eventually move this to the `arke` project so that its deployed to my servers and alerted on consistently + # DWIM naming history dwim comes from someone in the history of LISP. i like the connotation of doing what /i/, in particular, mean, rather than the general 'try and figure out what i mean' that it has in history.