I'm just starting to write my first skin and I am having trouble querying a json file. I am currently using the plugins WebParser and JsonParser.
JSON: http://ddragon.leagueoflegends.com/cdn/11.3.1/data/en_US/champion.json
I am trying to retrieve the "id" property value with a supplied "key" value. So for example, I have the # "266" and I want the query to return the "id" property which has the value "Aatrox".
Here is my code so far:
Code: Select all
[MeasureGetAllChampions]
Measure=Plugin
Plugin=WebParser
URL="http://ddragon.leagueoflegends.com/cdn/11.3.1/data/en_US/champion.json"
RegExp=(?siU)^(.*)$
[MeasureGetSpecificChampion]
Measure=Plugin
Plugin=JsonParser.dll
Source=[MeasureGetAllChampions]
;Query="$.data.Aatrox.id" ;This gets the needed ID but I don't actually know how to get the ID without knowing its parent.
;Query="$.data[?(@.key == 266)].id" ;This is not possible because each champion name is a property, not an element.
Code: Select all
{
"type": "champion",
"format": "standAloneComplex",
"version": "11.3.1",
"data": {
"Aatrox": {
"version": "11.3.1",
"id": "Aatrox",
"key": "266",
...
},
"Ahri": {
"version": "11.3.1",
"id": "Ahri",
"key": "103",
...
},
"Akali": {
"version": "11.3.1",
"id": "Akali",
"key": "84",
...
},
...
}
}