]> git.mxchange.org Git - fba.git/commitdiff
added script to sort instances by type
authorEnju Aihara <5-EnjuAihara@users.noreply.gitlab.varis.social>
Thu, 3 Mar 2022 19:49:56 +0000 (20:49 +0100)
committerEnju Aihara <5-EnjuAihara@users.noreply.gitlab.varis.social>
Thu, 3 Mar 2022 19:49:56 +0000 (20:49 +0100)
get_instance_type.py [new file with mode: 0644]

diff --git a/get_instance_type.py b/get_instance_type.py
new file mode 100644 (file)
index 0000000..04560fe
--- /dev/null
@@ -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