From bc02cc2c22e6590c71e7379ab344bd0fead7a6ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Honorez?= Date: Mon, 1 Jan 2024 10:54:45 +0100 Subject: [PATCH] fixing timedate + subscribe button --- Post_RSS_on_SubStack.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Post_RSS_on_SubStack.py b/Post_RSS_on_SubStack.py index 1171d5d..ae34644 100644 --- a/Post_RSS_on_SubStack.py +++ b/Post_RSS_on_SubStack.py @@ -82,7 +82,7 @@ class SubStackTask: await asyncio.sleep(sleep_seconds) # Run the daily task - await daily_task() + await self.daily_task() @@ -97,7 +97,7 @@ class SubStackTask: ) midnight_today = datetime.datetime.now(datetime.timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0) - yesterday_6am = datetime.now(timezone.utc).replace(hour=6, minute=0, second=0, microsecond=0) - timedelta(days=1) + yesterday_6am = datetime.datetime.now(datetime.timezone.utc).replace(hour=6, minute=0, second=0, microsecond=0) - datetime.timedelta(days=1) formatted_date = midnight_today.strftime('%a, %d %b %Y %H:%M:%S %z') @@ -169,16 +169,11 @@ class SubStackTask: {'content': feed.url, 'marks': [{'type': "link", 'href': feed.url}]}]}) + sub_stack_post.add({"type":"subscribeWidget", "message":"Abonnez-vous gratuitement pour recevoir chaque jour les news dans votre e-mail et soutenir mon travail."}) + draft = self.api.post_draft(sub_stack_post.get_draft()) self.api.prepublish_draft(draft.get("id")) - #self.api.publish_draft(draft.get("id")) - - - - - - - + self.api.publish_draft(draft.get("id")) async def main(login, password, account):