Skip to content

Unable to parse JSON from weather API #3

@mallardduck

Description

@mallardduck

Per the example from the readme, I'm trying to parse JSON data from weather API. I can verify the API is getting data and populating an initial [Weather] data field. The issue seems to happen when I try to parse that data for any internal value.

Here is the code in question:

[Weather]
Measure=Plugin
Plugin=WebParser.dll
UpdateRate=1200
Url=https://api.openweathermap.org/data/2.5/weather?lat=#Lat#&lon=#Lon#&appid=#ApiKey#&units=#units#
RegExp=(?siU)^(.*)$

[MeasureWeather.Location]
Measure=Plugin
Plugin=JsonParser.dll
Source=[Weather]
Query=name

I've tried to use the following permutations of query values:

  • Query=name
  • Query="name"
  • Query=".name"
  • Query="$name"

No matter what I try the location ends up empty/blank in the rainmeter log debugger.

The error in the logs is:

Error reading JToken from JsonReader. Path '', line 0, position 0. (Gemini\Sidebars\pollux.ini - [MeasureWeather.Location])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions