From abb430cee6ef13862a2124e428f82ca2951d9a3a Mon Sep 17 00:00:00 2001
From: Enju Aihara <5-EnjuAihara@users.noreply.gitlab.varis.social>
Date: Thu, 3 Mar 2022 20:49:56 +0100
Subject: [PATCH] added script to sort instances by type

---
 get_instance_type.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 get_instance_type.py

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
-- 
GitLab