@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', 'bookwyrm')), (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', 'takahe')), (SELECT COUNT(blocker) FROM blocks)")
known, indexed, blocks = fba.cursor.fetchone()
return {
import fba
fba.cursor.execute(
- "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"]]
+ "SELECT domain, software FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial', 'bookwyrm', 'takahe') 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():
fba.connection.commit()
except Exception as e:
print("error:", e, blocker, software)
- elif software == "friendica" or software == "misskey" or software == "bookwyrm":
+ elif software == "friendica" or software == "misskey" or software == "bookwyrm" or software == "takahe":
print("INFO: blocker:", blocker)
try:
if software == "friendica":
json = fba.get_misskey_blocks(blocker)
elif software == "bookwyrm":
json = fba.get_bookwyrm_blocks(blocker)
+ elif software == "takahe":
+ json = fba.get_takahe_blocks(blocker)
for block_level, blocks in json.items():
# NOISY-DEBUG: print("DEBUG: blocker,block_level,blocks():", blocker, block_level, len(blocks))
# Loop through some instances
fba.cursor.execute(
- "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"]]
+ "SELECT domain FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica', 'misskey', 'gotosocial', 'bookwyrm', 'takahe') AND (last_nodeinfo IS NULL OR last_nodeinfo < ?) ORDER BY rowid DESC", [time.time() - fba.config["recheck_instance"]]
)
for instance in fba.cursor.fetchall():