Only post the article if it hasn't been already

This commit is contained in:
Liam Steckler 2024-01-15 08:52:24 -08:00
parent 3c7dc2e299
commit 943af2f10b

View file

@ -128,15 +128,16 @@ with Session(engine) as session:
.attrs["content"]
.strip()
)
mastodon_post_result = mastodon.status_post(
status=article_description
+ "\n"
+ kuow_base_url
+ article_link
+ "\n#KUOW #News{}".format(additional_tag_string),
visibility="public",
)
article_record.post_id = mastodon_post_result["id"]
if not article_record.post_id:
mastodon_post_result = mastodon.status_post(
status=article_description
+ "\n"
+ kuow_base_url
+ article_link
+ "\n#KUOW #News{}".format(additional_tag_string),
visibility="public",
)
article_record.post_id = mastodon_post_result["id"]
except:
print("Could not load a description/post this article")