commit 0525c28050e83d2e2f25a910363a822018e3da98 Author: Tait Hoyem Date: Fri Feb 25 12:42:19 2022 -0700 Initial commit diff --git a/update.py b/update.py new file mode 100755 index 0000000..a24ebe7 --- /dev/null +++ b/update.py @@ -0,0 +1,18 @@ +import requests + +TOKEN = "EASYDNS_TOKEN" +DOMAINS = [ + "example.example.com", +] +USERNAME = "EASYDNS_USERNAME" + +# NO LONGER CONFIG + +TLD = DOMAINS[0].split(".")[-1] # can only update one TLD at a time +URL = f"https://{USERNAME}:{TOKEN}@api.cp.easydns.com/dyn/generic.php" + +for domain in DOMAINS: + resp = requests.get(URL, {"hostname": domain, "TLD": TLD}) + code = resp.status_code + content = str(resp.content) + print(f"CODE: {code}:\n{content}")