Hi,
I have this sample JSON as input:
{
"viewer": {
"home": {
"id": "uniqueid1",
"currentSubscription": {
"id": "uniqueid2",
"priceInfo": {
"current": {
"total": 1.7443,
"energy": 1.3188,
"tax": 0.4255,
"startsAt": "2022-10-18T17:00:00.000+02:00",
"level": "VERY_EXPENSIVE",
"currency": "SEK"
},
"today": [
{
"total": 0.4291,
"energy": 0.2666,
"tax": 0.1625,
"startsAt": "2022-10-18T00:00:00.000+02:00",
"level": "CHEAP",
"currency": "SEK"
},
{
"total": 0.4243,
"energy": 0.2627,
"tax": 0.1616,
"startsAt": "2022-10-18T01:00:00.000+02:00",
"level": "CHEAP",
"currency": "SEK"
},
//... more <clip>
{
"total": 0.3157,
"energy": 0.1758,
"tax": 0.1399,
"startsAt": "2022-10-18T23:00:00.000+02:00",
"level": "VERY_CHEAP",
"currency": "SEK"
}
],
"tomorrow": [
{
"total": 0.3143,
"energy": 0.1747,
"tax": 0.1396,
"startsAt": "2022-10-19T00:00:00.000+02:00",
"level": "VERY_CHEAP",
"currency": "SEK"
},
{
"total": 0.3103,
"energy": 0.1716,
"tax": 0.1387,
"startsAt": "2022-10-19T01:00:00.000+02:00",
"level": "VERY_CHEAP",
"currency": "SEK"
},
{
"total": 0.311,
"energy": 0.1721,
"tax": 0.1389,
"startsAt": "2022-10-19T02:00:00.000+02:00",
"level": "VERY_CHEAP",
"currency": "SEK"
},
//... more <clip>
{
"total": 0.365,
"energy": 0.2153,
"tax": 0.1497,
"startsAt": "2022-10-19T23:00:00.000+02:00",
"level": "VERY_CHEAP",
"currency": "SEK"
}
]
}
}
}
}
}
I need to :
- Iterate over both arrays
today
andtomorrow
- On each item convert date to Epoch (no issue)
- On each item do a HTTP POST request with the data
How can I do that the best/easiest way i Node-RED?