extract json data

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

extract json data

Postby proloy » Tue Sep 12, 2017 5:15 am

Hello,
I apologies, I am new in Livecode and i have no coding experience. But I am try to develop a caspercg client for sports broadcasting. Weather information is a part of my project.
I can get json data form API but don’t know how to extract data.
I am using EasyJSON

JSON DATA:
Code: Select all

{
  "response": {
  "version":"0.1",
   "features": {
  "hourly": 1
  }
   }
      ,
   "hourly_forecast": [
      {
      "FCTTIME": {
      "hour": "10","hour_padded": "10","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": "1505188800","pretty": "10:00 AM +06 on September 12, 2017","civil": "10:00 AM","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": "AM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "84", "metric": "29"},
      "dewpoint": {"english": "77", "metric": "25"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "61",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "S", "degrees": "171"},
      "wx": "Scattered Thunderstorms",
      "uvi": "8",
      "humidity": "79",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "94", "metric": "35"},
      "feelslike": {"english": "94", "metric": "35"},
      "qpf": {"english": "0.05", "metric": "1"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "49",
      "mslp": {"english": "29.81", "metric": "1009"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "11","hour_padded": "11","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": "1505192400","pretty": "11:00 AM +06 on September 12, 2017","civil": "11:00 AM","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": "AM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "85", "metric": "29"},
      "dewpoint": {"english": "77", "metric": "25"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "63",
      "wspd": {"english": "6", "metric": "10"},
      "wdir": {"dir": "S", "degrees": "173"},
      "wx": "Scattered Thunderstorms",
      "uvi": "9",
      "humidity": "78",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "94", "metric": "35"},
      "feelslike": {"english": "94", "metric": "35"},
      "qpf": {"english": "0.05", "metric": "1"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "47",
      "mslp": {"english": "29.8", "metric": "1009"}
      }
      ,
      {
      "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",
      "fctcode": "15",
      "sky": "75",
      "wspd": {"english": "6", "metric": "10"},
      "wdir": {"dir": "S", "degrees": "185"},
      "wx": "Thunderstorms",
      "uvi": "9",
      "humidity": "76",
      "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"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "13","hour_padded": "13","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": "1505199600","pretty": "1:00 PM +06 on September 12, 2017","civil": "1: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": "86", "metric": "30"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Thunderstorm",
      "icon": "tstorms",
      "fctcode": "15",
      "sky": "78",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "S", "degrees": "177"},
      "wx": "Thunderstorms",
      "uvi": "7",
      "humidity": "73",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "95", "metric": "35"},
      "feelslike": {"english": "95", "metric": "35"},
      "qpf": {"english": "0.06", "metric": "2"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "62",
      "mslp": {"english": "29.75", "metric": "1007"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "14","hour_padded": "14","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": "1505203200","pretty": "2:00 PM +06 on September 12, 2017","civil": "2: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": "83", "metric": "28"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "84",
      "wspd": {"english": "6", "metric": "10"},
      "wdir": {"dir": "SSE", "degrees": "161"},
      "wx": "Scattered Thunderstorms",
      "uvi": "5",
      "humidity": "78",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "90", "metric": "32"},
      "feelslike": {"english": "90", "metric": "32"},
      "qpf": {"english": "0.04", "metric": "1"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "50",
      "mslp": {"english": "29.72", "metric": "1006"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "15","hour_padded": "15","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": "1505206800","pretty": "3:00 PM +06 on September 12, 2017","civil": "3: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": "76", "metric": "24"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "87",
      "wspd": {"english": "7", "metric": "11"},
      "wdir": {"dir": "SSE", "degrees": "149"},
      "wx": "Scattered Thunderstorms",
      "uvi": "3",
      "humidity": "73",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "92", "metric": "33"},
      "feelslike": {"english": "92", "metric": "33"},
      "qpf": {"english": "0.03", "metric": "1"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "42",
      "mslp": {"english": "29.69", "metric": "1005"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "16","hour_padded": "16","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": "1505210400","pretty": "4:00 PM +06 on September 12, 2017","civil": "4: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": "86", "metric": "30"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "88",
      "wspd": {"english": "6", "metric": "10"},
      "wdir": {"dir": "SSE", "degrees": "151"},
      "wx": "Isolated Thunderstorms",
      "uvi": "1",
      "humidity": "72",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "95", "metric": "35"},
      "feelslike": {"english": "95", "metric": "35"},
      "qpf": {"english": "0.01", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "30",
      "mslp": {"english": "29.68", "metric": "1005"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "17","hour_padded": "17","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": "1505214000","pretty": "5:00 PM +06 on September 12, 2017","civil": "5: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": "84", "metric": "29"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Overcast",
      "icon": "cloudy",
      "fctcode": "4",
      "sky": "88",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "SSE", "degrees": "160"},
      "wx": "Cloudy",
      "uvi": "0",
      "humidity": "76",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "92", "metric": "33"},
      "feelslike": {"english": "92", "metric": "33"},
      "qpf": {"english": "0.0", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "24",
      "mslp": {"english": "29.68", "metric": "1005"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "18","hour_padded": "18","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": "1505217600","pretty": "6:00 PM +06 on September 12, 2017","civil": "6: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": "83", "metric": "28"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Overcast",
      "icon": "cloudy",
      "fctcode": "4",
      "sky": "85",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "SE", "degrees": "141"},
      "wx": "Cloudy",
      "uvi": "0",
      "humidity": "78",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "90", "metric": "32"},
      "feelslike": {"english": "90", "metric": "32"},
      "qpf": {"english": "0.0", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "16",
      "mslp": {"english": "29.69", "metric": "1005"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "19","hour_padded": "19","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": "1505221200","pretty": "7:00 PM +06 on September 12, 2017","civil": "7: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": "83", "metric": "28"},
      "dewpoint": {"english": "75", "metric": "24"},
      "condition": "Mostly Cloudy",
      "icon": "mostlycloudy",
      "fctcode": "3",
      "sky": "78",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "SSE", "degrees": "165"},
      "wx": "Mostly Cloudy",
      "uvi": "0",
      "humidity": "79",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "90", "metric": "32"},
      "feelslike": {"english": "90", "metric": "32"},
      "qpf": {"english": "0.0", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "19",
      "mslp": {"english": "29.71", "metric": "1006"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "20","hour_padded": "20","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": "1505224800","pretty": "8:00 PM +06 on September 12, 2017","civil": "8: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": "82", "metric": "28"},
      "dewpoint": {"english": "75", "metric": "24"},
      "condition": "Mostly Cloudy",
      "icon": "mostlycloudy",
      "fctcode": "3",
      "sky": "63",
      "wspd": {"english": "6", "metric": "10"},
      "wdir": {"dir": "SSE", "degrees": "157"},
      "wx": "Mostly Cloudy",
      "uvi": "0",
      "humidity": "81",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "90", "metric": "32"},
      "feelslike": {"english": "90", "metric": "32"},
      "qpf": {"english": "0.0", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "24",
      "mslp": {"english": "29.74", "metric": "1007"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "21","hour_padded": "21","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": "1505228400","pretty": "9:00 PM +06 on September 12, 2017","civil": "9: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": "82", "metric": "28"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "63",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "SSE", "degrees": "156"},
      "wx": "Scattered Thunderstorms",
      "uvi": "0",
      "humidity": "83",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "90", "metric": "32"},
      "feelslike": {"english": "90", "metric": "32"},
      "qpf": {"english": "0.01", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "37",
      "mslp": {"english": "29.77", "metric": "1008"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "22","hour_padded": "22","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": "1505232000","pretty": "10:00 PM +06 on September 12, 2017","civil": "10: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": "81", "metric": "27"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "68",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "SSE", "degrees": "160"},
      "wx": "Scattered Thunderstorms",
      "uvi": "0",
      "humidity": "84",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "86", "metric": "30"},
      "feelslike": {"english": "86", "metric": "30"},
      "qpf": {"english": "0.01", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "38",
      "mslp": {"english": "29.78", "metric": "1008"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "23","hour_padded": "23","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": "1505235600","pretty": "11:00 PM +06 on September 12, 2017","civil": "11: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": "81", "metric": "27"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Thunderstorm",
      "icon": "tstorms",
      "fctcode": "15",
      "sky": "75",
      "wspd": {"english": "4", "metric": "6"},
      "wdir": {"dir": "SSE", "degrees": "164"},
      "wx": "Thunderstorms",
      "uvi": "0",
      "humidity": "86",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "86", "metric": "30"},
      "feelslike": {"english": "86", "metric": "30"},
      "qpf": {"english": "0.03", "metric": "1"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "60",
      "mslp": {"english": "29.79", "metric": "1009"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "0","hour_padded": "00","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "Sep","mday": "13","mday_padded": "13","yday": "255","isdst": "0","epoch": "1505239200","pretty": "12:00 AM +06 on September 13, 2017","civil": "12:00 AM","month_name": "September","month_name_abbrev": "Sep","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "81", "metric": "27"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "75",
      "wspd": {"english": "4", "metric": "6"},
      "wdir": {"dir": "S", "degrees": "173"},
      "wx": "Scattered Thunderstorms",
      "uvi": "0",
      "humidity": "86",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "86", "metric": "30"},
      "feelslike": {"english": "86", "metric": "30"},
      "qpf": {"english": "0.03", "metric": "1"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "44",
      "mslp": {"english": "29.79", "metric": "1009"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "1","hour_padded": "01","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "Sep","mday": "13","mday_padded": "13","yday": "255","isdst": "0","epoch": "1505242800","pretty": "1:00 AM +06 on September 13, 2017","civil": "1:00 AM","month_name": "September","month_name_abbrev": "Sep","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "81", "metric": "27"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Thunderstorm",
      "icon": "tstorms",
      "fctcode": "15",
      "sky": "83",
      "wspd": {"english": "4", "metric": "6"},
      "wdir": {"dir": "S", "degrees": "187"},
      "wx": "Thunderstorms",
      "uvi": "0",
      "humidity": "86",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "86", "metric": "30"},
      "feelslike": {"english": "86", "metric": "30"},
      "qpf": {"english": "0.03", "metric": "1"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "64",
      "mslp": {"english": "29.77", "metric": "1008"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "9","hour_padded": "09","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "Sep","mday": "13","mday_padded": "13","yday": "255","isdst": "0","epoch": "1505271600","pretty": "9:00 AM +06 on September 13, 2017","civil": "9:00 AM","month_name": "September","month_name_abbrev": "Sep","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "83", "metric": "28"},
      "dewpoint": {"english": "77", "metric": "25"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "95",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "SSE", "degrees": "155"},
      "wx": "Scattered Thunderstorms",
      "uvi": "2",
      "humidity": "84",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "91", "metric": "33"},
      "feelslike": {"english": "91", "metric": "33"},
      "qpf": {"english": "0.02", "metric": "1"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "55",
      "mslp": {"english": "29.82", "metric": "1010"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "11","hour_padded": "11","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "Sep","mday": "13","mday_padded": "13","yday": "255","isdst": "0","epoch": "1505278800","pretty": "11:00 AM +06 on September 13, 2017","civil": "11:00 AM","month_name": "September","month_name_abbrev": "Sep","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "AM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "85", "metric": "29"},
      "dewpoint": {"english": "77", "metric": "25"},
      "condition": "Thunderstorm",
      "icon": "tstorms",
      "fctcode": "15",
      "sky": "91",
      "wspd": {"english": "4", "metric": "6"},
      "wdir": {"dir": "SSE", "degrees": "147"},
      "wx": "Thunderstorms",
      "uvi": "5",
      "humidity": "77",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "94", "metric": "35"},
      "feelslike": {"english": "94", "metric": "35"},
      "qpf": {"english": "0.02", "metric": "1"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "60",
      "mslp": {"english": "29.8", "metric": "1009"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "12","hour_padded": "12","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "Sep","mday": "13","mday_padded": "13","yday": "255","isdst": "0","epoch": "1505282400","pretty": "12:00 PM +06 on September 13, 2017","civil": "12:00 PM","month_name": "September","month_name_abbrev": "Sep","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "86", "metric": "30"},
      "dewpoint": {"english": "78", "metric": "26"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "86",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "S", "degrees": "185"},
      "wx": "Scattered Thunderstorms",
      "uvi": "7",
      "humidity": "76",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "99", "metric": "37"},
      "feelslike": {"english": "99", "metric": "37"},
      "qpf": {"english": "0.01", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "51",
      "mslp": {"english": "29.78", "metric": "1008"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "14","hour_padded": "14","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "Sep","mday": "13","mday_padded": "13","yday": "255","isdst": "0","epoch": "1505289600","pretty": "2:00 PM +06 on September 13, 2017","civil": "2:00 PM","month_name": "September","month_name_abbrev": "Sep","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "87", "metric": "31"},
      "dewpoint": {"english": "78", "metric": "26"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "79",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "S", "degrees": "180"},
      "wx": "Scattered Thunderstorms",
      "uvi": "5",
      "humidity": "74",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "103", "metric": "39"},
      "feelslike": {"english": "103", "metric": "39"},
      "qpf": {"english": "0.01", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "40",
      "mslp": {"english": "29.7", "metric": "1006"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "16","hour_padded": "16","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "Sep","mday": "13","mday_padded": "13","yday": "255","isdst": "0","epoch": "1505296800","pretty": "4:00 PM +06 on September 13, 2017","civil": "4:00 PM","month_name": "September","month_name_abbrev": "Sep","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "86", "metric": "30"},
      "dewpoint": {"english": "77", "metric": "25"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "71",
      "wspd": {"english": "5", "metric": "8"},
      "wdir": {"dir": "SSE", "degrees": "166"},
      "wx": "Isolated Thunderstorms",
      "uvi": "2",
      "humidity": "74",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "97", "metric": "36"},
      "feelslike": {"english": "97", "metric": "36"},
      "qpf": {"english": "0.01", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "31",
      "mslp": {"english": "29.67", "metric": "1005"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "17","hour_padded": "17","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "Sep","mday": "13","mday_padded": "13","yday": "255","isdst": "0","epoch": "1505300400","pretty": "5:00 PM +06 on September 13, 2017","civil": "5:00 PM","month_name": "September","month_name_abbrev": "Sep","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "85", "metric": "29"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Mostly Cloudy",
      "icon": "mostlycloudy",
      "fctcode": "3",
      "sky": "68",
      "wspd": {"english": "6", "metric": "10"},
      "wdir": {"dir": "S", "degrees": "176"},
      "wx": "Mostly Cloudy",
      "uvi": "0",
      "humidity": "76",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "92", "metric": "33"},
      "feelslike": {"english": "92", "metric": "33"},
      "qpf": {"english": "0.0", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "24",
      "mslp": {"english": "29.67", "metric": "1005"}
      }
      ,
      {
      "FCTTIME": {
      "hour": "21","hour_padded": "21","min": "00","min_unpadded": "0","sec": "0","year": "2017","mon": "9","mon_padded": "09","mon_abbrev": "Sep","mday": "13","mday_padded": "13","yday": "255","isdst": "0","epoch": "1505314800","pretty": "9:00 PM +06 on September 13, 2017","civil": "9:00 PM","month_name": "September","month_name_abbrev": "Sep","weekday_name": "Wednesday","weekday_name_night": "Wednesday Night","weekday_name_abbrev": "Wed","weekday_name_unlang": "Wednesday","weekday_name_night_unlang": "Wednesday Night","ampm": "PM","tz": "","age": "","UTCDATE": ""
      },
      "temp": {"english": "82", "metric": "28"},
      "dewpoint": {"english": "76", "metric": "24"},
      "condition": "Chance of a Thunderstorm",
      "icon": "chancetstorms",
      "fctcode": "14",
      "sky": "75",
      "wspd": {"english": "4", "metric": "6"},
      "wdir": {"dir": "S", "degrees": "171"},
      "wx": "Isolated Thunderstorms",
      "uvi": "0",
      "humidity": "84",
      "windchill": {"english": "-9999", "metric": "-9999"},
      "heatindex": {"english": "90", "metric": "32"},
      "feelslike": {"english": "90", "metric": "32"},
      "qpf": {"english": "0.0", "metric": "0"},
      "snow": {"english": "0.0", "metric": "0"},
      "pop": "30",
      "mslp": {"english": "29.76", "metric": "1008"}
      }
   ]
}



My code is below:
Code: Select all
on mouseUp
   put the text of fld "city" into tCityName
   put the text of fld "country" into tCountry
   
   
put "API link" &tCountry&"/"&tCityName& ".json" into tURL
put URL tURL into tRawJSON
put textDecode(tRawJSON,"UTF8") into fld "weatherdata"
put arrayFromJson(tRawJSON) into tArray

put tArray["hourly_forecast"]["humidity"] into fld "Temp"

end mouseUp


Please advice.

NB: My account does not have permission to post links or domain/page references. that's why can't share API link.
proloy
 
Posts: 10
Joined: Thu Aug 17, 2017 9:07 am

Re: extract json data

Postby bogs » Tue Sep 12, 2017 11:12 am

proloy wrote:NB: My account does not have permission to post links or domain/page references. that's why can't share API link.
Well, you could always put the url as plain text :)
Image
bogs
 
Posts: 375
Joined: Sat Feb 25, 2017 10:45 pm

Re: extract json data

Postby jiml » Tue Sep 12, 2017 11:14 pm

Try:

Code: Select all
put tArray["hourly_forecast"][N]["humidity"] into fld "Temp"


were [N] is the number of the record you want.

So:
Code: Select all
put tArray["hourly_forecast"][1]["humidity"] into fld "Temp"


would result in "chancetstorms" given the JSON you supplied.

Jim Lambert
jiml
 
Posts: 123
Joined: Sat Dec 09, 2006 1:27 am
Location: Los Angeles

Re: extract json data

Postby proloy » Wed Sep 13, 2017 5:28 am

Thanks Jiml, it's working.

jiml wrote:So:
Code: Select all
put tArray["hourly_forecast"][1]["humidity"] into fld "Temp"

Jim Lambert


My code is below for temp data
Code: Select all
put tArray["hourly_forecast"][1]["temp"]["metric"] into fld "Temp"
proloy
 
Posts: 10
Joined: Thu Aug 17, 2017 9:07 am


Return to Getting Started with LiveCode - Complete Beginners

Who is online

Users browsing this forum: No registered users and 2 guests