]> git.mxchange.org Git - fba.git/commitdiff
One more fork rewrite
authorMint <>
Sat, 3 Sep 2022 12:09:31 +0000 (15:09 +0300)
committerMint <>
Sat, 3 Sep 2022 12:09:31 +0000 (15:09 +0300)
fetch_blocks.py
fetch_instances.py

index 5302e6903ea26eebdca75b3e0c21e031da92f2b8..f79f394d84a98a3c316a4a661c28272b7ae5764a 100644 (file)
@@ -162,15 +162,11 @@ def get_type(domain: str) -> str:
         if res.ok and "text/html" in res.headers["content-type"]:
             res = get(f"https://{domain}/nodeinfo/2.1", headers=headers, timeout=5)
         if res.ok:
-            if res.json()["software"]["name"] == "akkoma":
+            if res.json()["software"]["name"] in ["akkoma", "rebased"]:
                 return "pleroma"
-            elif res.json()["software"]["name"] == "rebased":
-                return "pleroma"
-            elif res.json()["software"]["name"] == "hometown":
-                return "mastodon"
-            elif res.json()["software"]["name"] == "ecko":
+            elif res.json()["software"]["name"] in ["hometown", "ecko"]:
                 return "mastodon"
-            elif res.json()["software"]["name"] == "calckey":
+            elif res.json()["software"]["name"] in ["calckey", "groundpolis"]:
                 return "misskey"
             else:
                 return res.json()["software"]["name"]
index f7ada6c50a4d596e848222b8f2ef465c4af14bbf..6dcf9ab8e00a22159a7e3a13befd63136d3ab625 100644 (file)
@@ -34,15 +34,11 @@ def get_type(instdomain: str) -> str:
         if res.ok and "text/html" in res.headers["content-type"]:
             res = get(f"https://{instdomain}/nodeinfo/2.1", headers=headers, timeout=5)
         if res.ok:
-            if res.json()["software"]["name"] == "akkoma":
+            if res.json()["software"]["name"] in ["akkoma", "rebased"]:
                 return "pleroma"
-            elif res.json()["software"]["name"] == "rebased":
-                return "pleroma"
-            elif res.json()["software"]["name"] == "hometown":
-                return "mastodon"
-            elif res.json()["software"]["name"] == "ecko":
+            elif res.json()["software"]["name"] in ["hometown", "ecko"]:
                 return "mastodon"
-            elif res.json()["software"]["name"] == "calckey":
+            elif res.json()["software"]["name"] in ["calckey", "groundpolis"]:
                 return "misskey"
             else:
                 return res.json()["software"]["name"]