From fd94d547b361d2a175ab079f401c94b6ea362d6c Mon Sep 17 00:00:00 2001 From: Jean Lapostolle Date: Sat, 18 Feb 2023 02:31:20 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20lien=20live=20(=C3=A0=20tester)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyconfr-to-mastodon.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pyconfr-to-mastodon.py b/pyconfr-to-mastodon.py index 8cc7ac1..0731791 100644 --- a/pyconfr-to-mastodon.py +++ b/pyconfr-to-mastodon.py @@ -130,6 +130,14 @@ def parse_args(): return parser.parse_args() +salle2livelink = { + "franklin" : "https://indymotion.fr/w/dm3DZdr1FQGQJjyvfm419M", + "darwin" : "https://indymotion.fr/w/p7yGkZtpHeatdAaxwktweC", + "edison": "https://indymotion.fr/w/fBgSz6w6qPuseoN6p2VDA2", + "wegener": "https://indymotion.fr/w/kNpt3HaqJZBctY3v2AZGR2", + "poincaré": "https://indymotion.fr/w/bzkxJBMBcz2ucxXV8N5U1a" +} + def toot_for(talk, ahead_days=0): """Redact a toot for a given talk.""" if ahead_days: @@ -137,14 +145,18 @@ def toot_for(talk, ahead_days=0): else: msg = f"Salle {talk.room} : « {talk.title} » présenté par {talk.author}, c'est maintenant !" - msg += "\n\nLe programme : https://www.pycon.fr/2023/fr/schedule.html" + msg += f"\n\nRetrouvez la conférence en direct sur {salle2livelink[talk.room]}" return msg + + def live_toot(talks, mastodon: Mastodon, ahead_days=0): for talk in talks: if talk.category == "Sprint": continue # We don't toot sprints. + if talk.room not in salle2livelink.keys(): + continue toot = toot_for(talk, ahead_days) png_name = f"talk-{talk.id}.png" with suppress(FileNotFoundError):