Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 904

General Discussion • Help with making a simple weather skin using JSON from Open-Meteo

$
0
0
I'm trying to create a basic weather skin using data from the Open-Meteo API, which returns data in JSON format. I’ve managed to get the JSON downloaded using WebParser, but I’m struggling with parsing out the temperature value.

Here’s a snippet of what I have so far:

Code:

[MeasureWeather]Measure=PluginPlugin=WebParserURL=https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41&current_weather=trueRegExp=(?siU)"temperature":(.*?),"UpdateRate=600
And in the meter:

Code:

[MeterTemp]Meter=StringMeasureName=MeasureWeather
But all I’m getting is either nothing or just the whole string after "temperature":. I'm not sure if my regex is wrong or if I should be using lookaheads/lookbehinds?

Does anyone have experience parsing Open-Meteo’s output or know a cleaner way to extract just the current temperature?

Statistics: Posted by Discompard78 — Yesterday, 9:37 am — Replies 1 — Views 2892



Viewing all articles
Browse latest Browse all 904

Trending Articles