Skip to content

Instantly share code, notes, and snippets.

@b3z
Last active December 1, 2021 09:55
Show Gist options
  • Save b3z/3a2f7e0546acf08b2b5043ca5886c288 to your computer and use it in GitHub Desktop.
Save b3z/3a2f7e0546acf08b2b5043ca5886c288 to your computer and use it in GitHub Desktop.
Delete all ix.io entries of a user. (auth required in .netrc)
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