Hi there,
I’ve got a json-file:
{"response":
{"url":{
"2009-08-02":{"paid":1453,"organic":"11200"},
"2009-08-09":{"paid":1177,"organic":"10938"},
"2009-08-16":{"paid":1193,"organic":"11024"},
"2009-08-23":{"paid":261,"organic":"11556"}
}
I want to get the children from url like that:
local json = require ( "json" )
local str = functions.jsonFile( "visibility.json" )
local str = json.decode ( str )
print( str.response.url[1].paid )
but it doesn’t work. is there a way to count the children in url and then get each one by it’s index?
by the way: calling the actual row by the string( in this case the date ) works:
local json = require ( "json" )
local str = functions.jsonFile( "visibility.json" )
local str = json.decode ( str )
print ( str.response.url["2009-08-02"].paid )
Thank you very much for your help!
[import]uid: 140000 topic_id: 32086 reply_id: 332086[/import]