Last active
December 1, 2021 09:55
-
-
Save b3z/3a2f7e0546acf08b2b5043ca5886c288 to your computer and use it in GitHub Desktop.
Delete all ix.io entries of a user. (auth required in .netrc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
user = "b3z" | |
response = requests.get(f"http://ix.io/user/{user}") | |
if response.status_code != 200: | |
print (f"Error:{response.status_code}") | |
res = re.compile("href=\"\/[a-zA-Z0-9]{4}\"").findall(str(response.content)) | |
res = list(map((lambda x : x.replace('\"', '').replace("href=/", '')), res)) | |
for id in res: | |
response = requests.delete(f"http://ix.io/{id}") | |
print(response.status_code, response.content) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment