From 0f7c70a030112e9d3c6a4b0d209ec37de5d5e403 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 22 May 2023 04:13:27 +0200 Subject: [PATCH] Continued: - also include bookwyrm in instance discovering (blocks is WIP) --- api.py | 2 +- fetch_blocks.py | 2 +- fetch_instances.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api.py b/api.py index 37b990d..2ac1ff9 100644 --- a/api.py +++ b/api.py @@ -14,7 +14,7 @@ templates = Jinja2Templates(directory=".") @app.get(fba.config["base_url"] + "/info") def info(): - fba.cursor.execute("SELECT (SELECT COUNT(domain) FROM instances), (SELECT COUNT(domain) FROM instances WHERE software IN ('pleroma', 'mastodon', 'misskey', 'gotosocial', 'friendica')), (SELECT COUNT(blocker) FROM blocks)") + fba.cursor.execute("SELECT (SELECT COUNT(domain) FROM instances), (SELECT COUNT(domain) FROM instances WHERE software IN ('pleroma', 'mastodon', 'misskey', 'gotosocial', 'friendica', 'bookwyrm')), (SELECT COUNT(blocker) FROM blocks)") known, indexed, blocks = fba.cursor.fetchone() return { diff --git a/fetch_blocks.py b/fetch_blocks.py index 9420689..4bdf158 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -6,7 +6,7 @@ import re import fba fba.cursor.execute( - "SELECT domain, software FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial') AND (last_blocked IS NULL OR last_blocked < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_block"]] + "SELECT domain, software FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial', 'bookwyrm') AND (last_blocked IS NULL OR last_blocked < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_block"]] ) for blocker, software in fba.cursor.fetchall(): diff --git a/fetch_instances.py b/fetch_instances.py index 0975ff4..7ebebc6 100644 --- a/fetch_instances.py +++ b/fetch_instances.py @@ -55,7 +55,7 @@ fetch_instances(instance, None) # Loop through some instances fba.cursor.execute( - "SELECT domain FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial') AND (last_nodeinfo IS NULL OR last_nodeinfo < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_instance"]] + "SELECT domain FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial', 'bookwyrm') AND (last_nodeinfo IS NULL OR last_nodeinfo < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_instance"]] ) for instance in fba.cursor.fetchall(): -- 2.39.5