我正在尝试使用以下方法从 Weather Underground API 获得 3 天的预报:
var Forcast = parsed_json['forecast']['txt_forecast']['period'][0]['fcttext_metric'];
它不工作,我没有使用 json 的经验,所以我不知道我需要做什么才能让它工作。Bellow是我想要的json文件的一部分:
"forecast": {
"txt_forecast": {
"date": "2:00 PM PDT",
"forecastday": [{
"period": 0,
"icon": "partlycloudy",
"icon_url": "http://icons-ak.wxug.com/i/c/k/partlycloudy.gif",
"title": "Tuesday",
"fcttext": "Partly cloudy in the morning, then clear. High of 68F. Breezy. Winds from the West at 10 to 25 mph.",
"fcttext_metric": "Partly cloudy in the morning, then clear. High of 20C. Windy. Winds from the West at 20 to 35 km/h.",
"pop": "0"
}, {
有人可以告诉我如何获得我需要的信息。