From: Enju Aihara <5-EnjuAihara@users.noreply.gitlab.varis.social> Date: Thu, 3 Mar 2022 19:49:56 +0000 (+0100) Subject: added script to sort instances by type X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=abb430cee6ef13862a2124e428f82ca2951d9a3a;p=fba.git added script to sort instances by type --- diff --git a/get_instance_type.py b/get_instance_type.py new file mode 100644 index 0000000..04560fe --- /dev/null +++ b/get_instance_type.py @@ -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) \ No newline at end of file