+ elif software == "friendica"
+ print(blocker)
+ try:
+ json = get_friendica_blocks(blocker)
+ for blocks in json.items():
+ for instance in blocks:
+ blocked, reason = instance.values()
+ blocked == blocked.lower()
+ blocker == blocker.lower()
+ c.execute(
+ "select domain from instances where domain = ?", (blocked,)
+ )
+ if c.fetchone() == None:
+ c.execute(
+ "insert into instances select ?, ?, ?",
+ (blocked, get_hash(blocked), get_type(blocked)),
+ )
+ c.execute(
+ "select * from blocks where blocker = ? and blocked = ?",
+ (blocker, blocked),
+ )
+ if c.fetchone() == None:
+ c.execute(
+ "insert into blocks select ?, ?, ?, ?",
+ (
+ blocker,
+ blocked,
+ reason,
+ "reject",
+ ),
+ )
+ conn.commit()
+ except Exception as e:
+ print("error:", e, blocker)