Only post the article if it hasn't been already
This commit is contained in:
parent
3c7dc2e299
commit
943af2f10b
1 changed files with 10 additions and 9 deletions
|
@ -128,15 +128,16 @@ with Session(engine) as session:
|
||||||
.attrs["content"]
|
.attrs["content"]
|
||||||
.strip()
|
.strip()
|
||||||
)
|
)
|
||||||
mastodon_post_result = mastodon.status_post(
|
if not article_record.post_id:
|
||||||
status=article_description
|
mastodon_post_result = mastodon.status_post(
|
||||||
+ "\n"
|
status=article_description
|
||||||
+ kuow_base_url
|
+ "\n"
|
||||||
+ article_link
|
+ kuow_base_url
|
||||||
+ "\n#KUOW #News{}".format(additional_tag_string),
|
+ article_link
|
||||||
visibility="public",
|
+ "\n#KUOW #News{}".format(additional_tag_string),
|
||||||
)
|
visibility="public",
|
||||||
article_record.post_id = mastodon_post_result["id"]
|
)
|
||||||
|
article_record.post_id = mastodon_post_result["id"]
|
||||||
except:
|
except:
|
||||||
print("Could not load a description/post this article")
|
print("Could not load a description/post this article")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue