From f0032a7146228456dd00deef22c5e7fd64fcad3f Mon Sep 17 00:00:00 2001 From: Mint <> Date: Sat, 3 Sep 2022 15:09:31 +0300 Subject: [PATCH] One more fork rewrite --- fetch_blocks.py | 10 +++------- fetch_instances.py | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/fetch_blocks.py b/fetch_blocks.py index 5302e69..f79f394 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -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"] diff --git a/fetch_instances.py b/fetch_instances.py index f7ada6c..6dcf9ab 100644 --- a/fetch_instances.py +++ b/fetch_instances.py @@ -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"] -- 2.39.5