From 0141b513a926ab68a25addbca3b3ab92cb36d7e9 Mon Sep 17 00:00:00 2001 From: Lynne Date: Fri, 11 Jan 2019 23:05:45 +1000 Subject: [PATCH] minor fix --- main.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index adbf8ab..3a82ece 100755 --- a/main.py +++ b/main.py @@ -18,7 +18,7 @@ cfg = json.load(open('config.json', 'r')) if 'site' not in cfg: cfg['website'] = "https://botsin.space" if 'cw' not in cfg: - cfg['cw'] = "" + cfg['cw'] = None #if the user is using a (very!) old version that still uses the .secret files, migrate to the new method if os.path.exists("clientcred.secret"): @@ -154,8 +154,8 @@ for f in following: done = True break pid = re.search(r"[^\/]+$", oi['object']['id']).group(0) - c.execute("REPLACE INTO toots (id, userid, uri, content) VALUES (?, ?, ?, ?)", - (pid, + c.execute("REPLACE INTO toots (id, userid, uri, content) VALUES (?, ?, ?, ?)", ( + pid, f.id, oi['object']['id'], toot @@ -164,7 +164,6 @@ for f in following: pass except: pass #ignore any toots that don't successfully go into the DB - # sys.exit(0) if not pleroma: r = requests.get(j['prev'], timeout=15) else: @@ -176,7 +175,6 @@ for f in following: except: print("Encountered an error! Saving toots to database and moving to next followed account.") db.commit() - # db.close() print("Done!")