Hi all,
I made a public test calendar to sneak some JSON from so I can try out syncing a calendar in a Corona app - I am able to download the unformatted data, but when I try to find a specific item, I get “returns nil value” errors.
Here is the code (including URL and things I have tried) - NOTE: the JSON validates though an online tool.
local json = require "json" local dataURL = "http://www.google.com/calendar/feeds/csnfcl6h9k9qh769t6rs105pto@group.calendar.google.com/public/full?alt=json" local function newDataListener(event) if (event.isError) then print ("Error!") else -- print ( data[1] ) print ( "RESPONSE: " .. event.response ) local data = json.decode(event.response) print(data.title[2]) --table.foreach(data,print) --local t = event.response --t = json.decode( t ) --if #t \> 0 then --print ("Number of records " .. tostring(#t) ) --print ( t[1]["content"] ) --else --print ("no records found") -- end end end network.request ( dataURL, "GET", newDataListener )
Thanks!