06.12.2019, 11:42
I am all new to the LM and are on a steep learning path. I've been struggling to get the yr.no xml API script to work for my Yr location. However, after further inspections and testing I found out that the xml from norwegian locations have a subtle difference compared to other location. I could get all others to work, but not for any norwegian places.
For norwegian places you get an additional text section as below:
<forecast>
<text>
<location name="Oslo">
<time from="2019-12-06" to="2019-12-06">
<title>Obs! Note!</title>
<body>Tekstvarsel-tjenesten er nedlagt. The text forecast service is suspended</body>
</time>
</location>
</text>
Because of this the first index to values must be 2 instead of 1. That eventually made things work for me. I don't know why nobody has mentioned this before. Maybe this is a recent change? Or is it me missing something here...?
For norwegian places you get an additional text section as below:
<forecast>
<text>
<location name="Oslo">
<time from="2019-12-06" to="2019-12-06">
<title>Obs! Note!</title>
<body>Tekstvarsel-tjenesten er nedlagt. The text forecast service is suspended</body>
</time>
</location>
</text>
Because of this the first index to values must be 2 instead of 1. That eventually made things work for me. I don't know why nobody has mentioned this before. Maybe this is a recent change? Or is it me missing something here...?