mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 08:38:59 +00:00
fixed a silly
This commit is contained in:
parent
898f2f7aae
commit
170a666496
2 changed files with 3 additions and 2 deletions
|
@ -122,7 +122,7 @@ def generate_output(handle):
|
||||||
# also format handles without instances, e.g. @user instead of @user@instan.ce
|
# also format handles without instances, e.g. @user instead of @user@instan.ce
|
||||||
post = re.sub(r"(?<!\S)@(\w+)", r"@{}\1".format(zws), post)
|
post = re.sub(r"(?<!\S)@(\w+)", r"@{}\1".format(zws), post)
|
||||||
|
|
||||||
return post
|
return bot, post
|
||||||
|
|
||||||
|
|
||||||
def make_post(args):
|
def make_post(args):
|
||||||
|
@ -133,7 +133,7 @@ def make_post(args):
|
||||||
acct = args[3]
|
acct = args[3]
|
||||||
handle = args[0]
|
handle = args[0]
|
||||||
|
|
||||||
post = generate_output(handle)
|
bot, post = generate_output(handle)
|
||||||
|
|
||||||
# print(post)
|
# print(post)
|
||||||
visibility = bot['post_privacy'] if len(args) == 1 else args[2]
|
visibility = bot['post_privacy'] if len(args) == 1 else args[2]
|
||||||
|
|
|
@ -48,6 +48,7 @@ db.commit()
|
||||||
|
|
||||||
print("Generating posts")
|
print("Generating posts")
|
||||||
cursor.execute("SELECT handle FROM bots WHERE enabled = TRUE AND TIMESTAMPDIFF(MINUTE, last_post, CURRENT_TIMESTAMP()) >= post_frequency")
|
cursor.execute("SELECT handle FROM bots WHERE enabled = TRUE AND TIMESTAMPDIFF(MINUTE, last_post, CURRENT_TIMESTAMP()) >= post_frequency")
|
||||||
|
# cursor.execute("SELECT handle FROM bots WHERE enabled = TRUE")
|
||||||
bots = cursor.fetchall()
|
bots = cursor.fetchall()
|
||||||
|
|
||||||
with Pool(cfg['service_threads']) as p:
|
with Pool(cfg['service_threads']) as p:
|
||||||
|
|
Loading…
Reference in a new issue