1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-25 08:38:59 +00:00

add missing db connection

This commit is contained in:
Lynne Megido 2020-01-20 14:40:59 +10:00
parent 8cab227531
commit fe01416134
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90

View file

@ -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']