From fe01416134731d8d9e0ed5182e96279b065391a4 Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 20 Jan 2020 14:40:59 +1000 Subject: [PATCH] add missing db connection --- app/functions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/functions.py b/app/functions.py index aa7725f..00229e2 100644 --- a/app/functions.py +++ b/app/functions.py @@ -127,6 +127,8 @@ def make_post(args): acct = args[3] handle = args[0] + # print("Generating post for {}".format(handle)) + bot, post = generate_output(handle) client = Mastodon( @@ -136,6 +138,14 @@ def make_post(args): api_base_url = "https://{}".format(handle.split("@")[2]) ) + db = MySQLdb.connect( + host = cfg['db_host'], + user=cfg['db_user'], + passwd=cfg['db_pass'], + db=cfg['db_name'] + ) + c = db.cursor() + # print(post) visibility = bot['post_privacy'] if len(args) == 1 else args[2] visibilities = ['public', 'unlisted', 'private']