15 lines
616 B
Markdown
15 lines
616 B
Markdown
|
# jcal unfucker
|
||
|
|
||
|
This oneliner converts streaming optimised jCal format from [rfc7265](https://datatracker.ietf.org/doc/rfc7265/) into a developer frendly json structure.
|
||
|
|
||
|
## The actual code
|
||
|
|
||
|
`jq '[(.[2][]|select(.[0] == "vevent")|.[1]|[.[]|{"key": .[0], "value": .[3]}]|from_entries)]'`
|
||
|
|
||
|
## Example Usage
|
||
|
|
||
|
```bash
|
||
|
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][]|select(.[0] == "vevent")|.[1]|[.[]|{"key": .[0], "value": .[3]}]|from_entries)]'
|
||
|
```
|