I don’t know if you’ve started on this part of the restructuring yet. But would it be possible to have the meeting reminders from Fedocal be posted to this site on behalf of the zinebot user?
My thought here is that I (or another Fedora Magazine editor) could then log onto this site as the zinebot user to edit or delete a post when necessary (e.g. to cancel a weekly meeting).
Have your bot use the Fedocal API and run weekly to find meetings in a future week (say, 2 weeks from now). Code below.
Instead of printing, use that plus the Discourse API to postmsg to the Magazine calendar topic. (I can help provide a code sample here if you need it.)
Use the API to to set that post to be a wiki [1] so that anyone can update it to remove the date and instead put in a note that the meeting is canceled.
This is sample code to get meeting information for all upcoming meetings on a given calendar, in this case, marketing. It could be refined with a regex to filter on meeting_name if you want to make sure it’s just Magazine meetings.
I’m not sure what you are asking. I’m fine with having some other bot manage the posting of the meeting reminders to Discourse if that is what you are asking.
FWIW, I wouldn’t bother with trying to preserve posts that were made to old Fedora Magazine meeting reminders. I really don’t think there is anything important or worth preserving there.
I made it so it uses an API key with permission to post as anyone (but it’s limited to just posting, so it could be annoying but not devastating if the key were compromised). Then, it’s a matter configuring
calendar
meeting name
who to post as
topic to post to
for each meeting we want bridged.
Also, right now, it doesn’t retry on failure or anything, and it probably should so meetings aren’t missed. (It should at least handle http 429 responses — too many API requests per minute.) There are number of more sophisticated things we could add, but I think with that it’s probably enough to get going.
This is now in place and set to run every Monday morning to refresh upcoming meetings three weeks ahead.
This is far from perfect, as it doesn’t work very well as a reminder of, say, “tomorrow’s meeting”. It would be better for it to trigger on fedocal.calendar.update from the message bus and rewrite either any of its messages that have changed (somewhat tricky) or just delete all entries and recreate. There is also a fedocal.meeting.reminder, which is described as “These messages are published by a cronjob when time gets close to certain meetings scheduled in the fedocal calendaring system.” — I’m unclear on exactly what “certain meetings” means — maybe it’s at the same time an email reminder goes out, or maybe it’s something different.
I’m definitely not getting in the business of generating mass emails.
Of course, fedocal itself can still generate the reminders. The question is — where to send them to?
We guess I could have a second script run every day to add a “meeting tomorrow!” note to the calendar post.
Actually, I feel like there’s a “conflict of notification interest” here (caused by Discourse calendar using replies as the source of calendar event data). As a user, I don’t really want to be notified when new events are added to the calendar. I do want to be notified when that event is upcoming.
It might really be better to discard the calendar plugin and make something of our own which reads from Fedocal and updates the first post directly. It’s not like the calendar plug in is perfect. We could probably create a theme component to make a calendar-style display — or just stick to list view. (Or, um, make markdown table calendars.)
Ah, yeah — the current thing should work well for that … just add the publication dates as replies and there you go. That’d be harder to make work with a bridge bot unless you put each article date into Fedocal, which is a little heavyweight.