chore: simplify

This commit is contained in:
andig 2024-12-02 09:06:43 +01:00
parent 45169e54eb
commit 4e778a2cd2

View file

@ -15,4 +15,9 @@ render: |
forecast:
source: http
uri: https://api.allinpower.nl/troodon/api/p/spot_market/prices/?product_type=ELK
jq: '[.timestamps, .prices] | transpose | map({ "start": (.[0] | strptime("%Y-%m-%dT%H:%M:%S.%f%z") | strftime("%Y-%m-%dT%H:%M:%SZ")), "end": (.[0] | strptime("%Y-%m-%dT%H:%M:%S.%f%z") | mktime + 3600 | strftime("%Y-%m-%dT%H:%M:%SZ")), "price": .[1] }) | tostring'
jq: |
[.timestamps, .prices] | transpose | map({
"start": (.[0] | strptime("%FT%T.%f%z") | strftime("%FT%TZ")),
"end": (.[0] | strptime("%FT%T.%f%z") | mktime + 3600 | strftime("%FT%TZ")),
"price": .[1]
}) | tostring'