added script to sort instances by type
This commit is contained in:
parent
c1bf2225a9
commit
abb430cee6
22
get_instance_type.py
Normal file
22
get_instance_type.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
from requests import get
|
||||||
|
|
||||||
|
list = []
|
||||||
|
|
||||||
|
with open("instances.txt", "r") as f:
|
||||||
|
list = f.readlines()
|
||||||
|
|
||||||
|
for line in list:
|
||||||
|
print(line.replace("\n", ""))
|
||||||
|
try:
|
||||||
|
res = get("https://"+line.replace("\n", ""), timeout=5)
|
||||||
|
if "pleroma" in res.text.lower():
|
||||||
|
with open("pleroma_instances.txt", "a") as f:
|
||||||
|
f.write(line)
|
||||||
|
elif "mastodon" in res.text.lower():
|
||||||
|
with open("mastodon_instances.txt", "a") as f:
|
||||||
|
f.write(line)
|
||||||
|
else:
|
||||||
|
with open("other_instances.txt", "a") as f:
|
||||||
|
f.write(line)
|
||||||
|
except:
|
||||||
|
print("error:", line)
|
Loading…
x
Reference in New Issue
Block a user