]> git.mxchange.org Git - fba.git/blob - get_instance_type.py
sorted instances by name
[fba.git] / get_instance_type.py
1 from requests import get
2
3 list = []
4
5 with open("instances.txt", "r") as f:
6     list = f.readlines()
7
8 for line in list:
9     print(line.replace("\n", ""))
10     try:
11         res = get("https://"+line.replace("\n", ""), timeout=5)
12         if "pleroma" in res.text.lower():
13             with open("pleroma_instances.txt", "a") as f:
14                 f.write(line)
15         elif "mastodon" in res.text.lower():
16             with open("mastodon_instances.txt", "a") as f:
17                 f.write(line)
18         else:
19             with open("other_instances.txt", "a") as f:
20                 f.write(line)
21     except:
22         print("error:", line)