Importing birthday ICS created from VCF contact data
I recently moved away from Nextcloud, and now use Baikal instead. One feature I miss is the birthday calendar, that automatically creates events for each contact.
With a bit of fussing it’s possible to do that more or less
manually, using cadaver to get and put files directly on
Baikal, and a Python script that creates ICS files (events) from VCF
files (contact sheet).
git clone https://github.com/FoxP/VCF-to-ICS
Retrieve all the contacts:
cadaver https://chaton.mysite.com/baikal/dav.php/addressbooks/yves/default
mget *.vcf
From each contact that contains a birthday entry, create an ICS with the birthday.
for i in `grep -l BDAY *`; do python3 ~/src/VCF-to-ICS/vcf_to_ics.py -i $i -o `basename $i .vcf`.ics --name Birthdays; done
The event dates are not the right format; you need to turn this:
DTSTART:20101225
Into that:
DTSTART:20101225T000000
and at best also add the year in the summary, lest it becomes invisible in some interfaces. With a vi macro:
vi *.ics
qa/DTSTART<CR>f:vlllyAT000000/SUMMARY<CR>A(<ESC>pA):wn
@a
Then send all the files:
cadaver https://chaton.mysite.com/baikal/dav.php/calendars/yves/<ID>
mput *.ics
(You will find the ID in the Web interface of the calendar,
or cadaver to the folder and ls).
Done!