HSF/hsf.github.io

Sync between HSF Indico and Google Calendar

Closed this issue · 12 comments

This is not strictly an HSF website issue, but...

At the moment adding quotidian HSF meetings (i.e., in Indico) into the HSF Google Calendar is done by hand. This is tedious and error prone.

It would be much nicer to sync this automatically, using the Indico APIs to harvest events and Google APIs to push them into the calendar.

Some care needs to be taken with the sync as we always need to add events into the calendar by hand (e.g., experiment weeks, major conferences and workshops). However, it would be useful if Indico events that update themselves or get cancelled would be reflected in the calendar.

@roiser you said you might be able to adapt a script that you already have? If you accept the org invite then I should be able to assign this issue to you.

Yes I have a private script which syncs events in indico categories to a google calendar. I can give it a try to adapt it to what's needed in HSF

Yes, that would be great. I think you should have permissions to modify the calendar (by virtue of your role as coordinator), but let me know if you can't.

Just as a workaround for now, I added the Indico feed to my own work Google Calendar and then I can just duplicate events into the HSF calendar, which is a lot quicker than manually adding entries

Note we have progress on this now, see https://github.com/HSF/merge2gcal

I've made an initial commit of the files after a bit of cleanup.

There is also a working version of the scripts (one needs to create credentials) on my laptop. Next step would be to move the script to some other computing resource than my laptop.

@graeme-a-stewart thanks for providing the machine. I've now moved the scripts to python 3 and set them up on the new node. The script shall run every 15 minutes (0,15,30,45) via crontab. Logs are rotated in the /log directory. So far so good, the first run was successful. Whenever new events are added in one of the indico agendas they should appear within 15 mins in the google calendar now.

Hi @roiser - so I created a few events in Indico last night and I was waiting for them to sync, but there's still nothing this morning. These were:

https://indico.cern.ch/event/933083/
https://indico.cern.ch/event/933022/

And WGs have put in a few others:

https://indico.cern.ch/event/914610/
https://indico.cern.ch/event/932698/
https://indico.cern.ch/event/932570/

Can you take a look?

Hi @graeme-a-stewart I see them in the calendars. I'm sync'ing to the calendars with the ids

jd5bdhh5eq.......@group.calendar.google.com (public)
mh9up33b8.......@group.calendar.google.com (non-public)

but strange enough since the script started yesterday to run for the first time (15:45) the logs don't show any sync happening. Could it be the entries were made before?

Could you remove the test entries, they should then disappear also in the google calendar, and also create another one?

Ah, wait... now I understand! The sync is to the testing public calendar, which is not really public at all. Yes, all the events are in that calendar as expected.

What we want to do (if you feel confident) is start syncing to the real HSF public calendar:

e4v33e1a1drbncdle1n03ahpcs@group.calendar.google.com

So, did he fire six shots or only five?' 😄

0 shots but the events are there, this is somehow surprising ....

All good now, closed with the deployment of https://github.com/HSF/merge2gcal onto hsf-calsync.cern.ch.