I apologies, I am new in Livecode and i have no coding experience. I am trying to extract wunderground hourly json data in livecode, but i can't
JSON Data:
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"hourly": 1
}
}
,
"hourly_forecast": [
{
"FCTTIME": {
"hour": "12","hour_padded": "12","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "Sep","mday": "12","mday_padded": "12","yday": "254","isdst": "0","epoch": "1505196000","pretty": "12:00 PM +06 on September 12, 2017","civil": "12:00 PM","month_name": "September","month_name_abbrev": "Sep","weekday_name": "Tuesday","weekday_name_night": "Tuesday Night","weekday_name_abbrev": "Tue","weekday_name_unlang": "Tuesday","weekday_name_night_unlang": "Tuesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
},
"temp": {"english": "85", "metric": "29"},
"dewpoint": {"english": "77", "metric": "25"},
"condition": "Thunderstorm",
"icon": "tstorms",
"icon_url":"http://icons.wxug.com/i/c/k/tstorms.gif",
"fctcode": "15",
"sky": "75",
"wspd": {"english": "4", "metric": "6"},
"wdir": {"dir": "S", "degrees": "185"},
"wx": "Thunderstorms",
"uvi": "11",
"humidity": "77",
"windchill": {"english": "-9999", "metric": "-9999"},
"heatindex": {"english": "94", "metric": "35"},
"feelslike": {"english": "94", "metric": "35"},
"qpf": {"english": "0.03", "metric": "1"},
"snow": {"english": "0.0", "metric": "0"},
"pop": "61",
"mslp": {"english": "29.78", "metric": "1008"}
}
,
I copied EasyJSON https://github.com/luxlogica/easyjson into my StackScript. And my button code looks like this:
on mouseUp
put the text of fld "city" into tCityName
put the text of fld "country" into tCountry
put "http://api.wunderground.com/api/dfabb014e63a7457/hourly/q/" &tCountry&"/"&tCityName& ".json" into tURL
put URL tURL into tRawJSON
put textDecode(tRawJSON,"UTF8") into fld "weatherdata"
put arrayFromJson(tRawJSON) into tArray
put tArray["FCTTIME"]["temp"] into fld "Temp"
end mouseUp