From: Roland Häder Date: Mon, 22 May 2023 02:13:27 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0f7c70a030112e9d3c6a4b0d209ec37de5d5e403;p=fba.git Continued: - also include bookwyrm in instance discovering (blocks is WIP) --- 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():