fixing timedate + subscribe button
This commit is contained in:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user