Oneliner to covert jcal to usable json
Find a file
2023-10-18 17:26:25 +02:00
example.jcal init 2023-10-18 13:11:53 +02:00
jcal-unfuck.jq Fix: removed usage pick(); Refactored map() usage; moved type property into prefix addition 2023-10-18 17:26:25 +02:00
README.md Fix: removed usage pick(); Refactored map() usage; moved type property into prefix addition 2023-10-18 17:26:25 +02:00

jcal unfucker

This oneliner converts streaming optimised jCal format from rfc7265 into a developer frendly json structure.

The actual code

jq '.[2] | map({_type: .[0]} + (.[1] | map({key: .[0], value: .[3]}) | from_entries))'

Example Usage

curl -sH 'Accept: application/calendar+json' https://cloud.kraut.space/remote.php/dav/public-calendars/2EkPGt3PF6WwYsA3\?export\&expand\=1\&start\=$(date -d '' +%s)\&end\=$(date -d 'next month' +%s) \
| jq '.[2]|map({_type:.[0]}+(.[1]|map({key:.[0],value:.[3]})|from_entries))'