summaryrefslogtreecommitdiff
path: root/other_scripts/desec.py
diff options
context:
space:
mode:
authoruvok cheetah2025-02-02 14:59:12 +0100
committeruvok cheetah2025-02-02 14:59:12 +0100
commit2b31cd58c12f8e6856435445cbfb61a130c37f7a (patch)
tree6e2d1d017bcddcf4efbbeea28c0217dc41f718f2 /other_scripts/desec.py
parent6078935504c752afebefd8e570a6f29f6b05bcdb (diff)
Various desec stuff
Diffstat (limited to 'other_scripts/desec.py')
-rw-r--r--other_scripts/desec.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/other_scripts/desec.py b/other_scripts/desec.py
new file mode 100644
index 0000000..ac7b9c4
--- /dev/null
+++ b/other_scripts/desec.py
@@ -0,0 +1,26 @@
+import requests
+
+url = "https://desec.io/api/v1/domains/"
+response = requests.get(url, headers={"Authorization": "Token <your_token_here>"})
+data = response.json()
+
+domains = [item['name'] for item in data]
+
+print("| Counter | Name |")
+print("| ------- | ---- |")
+for i, name in enumerate(domains):
+ print(f"| {i+1} | {name} |")
+
+query = input("Enter a counter or a name: ")
+seldomain = None
+
+try:
+ query = int(query)
+ if query < 1 or query > len(domains):
+ raise ValueError
+ seldomain = domains[query-1]
+except ValueError:
+ if query not in domains:
+ print("The name is not present in the table.")
+ continue
+ seldomain = query