Skip to content

Instantly share code, notes, and snippets.

@replete
Created June 9, 2023 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save replete/2e328f88ccc012a3043c025302268dc5 to your computer and use it in GitHub Desktop.
Save replete/2e328f88ccc012a3043c025302268dc5 to your computer and use it in GitHub Desktop.
Obsidian render 3day weather from wc - incomplete js
let data = {
"current_condition": [
{
"FeelsLikeC": "5",
"FeelsLikeF": "41",
"cloudcover": "75",
"humidity": "53",
"localObsDateTime": "2023-02-23 03:03 PM",
"observation_time": "03:03 PM",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1023",
"pressureInches": "30",
"temp_C": "8",
"temp_F": "46",
"uvIndex": "3",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NNW",
"winddirDegree": "340",
"windspeedKmph": "20",
"windspeedMiles": "13"
}
],
"nearest_area": [
{
"areaName": [
{
"value": "Holyhead"
}
],
"country": [
{
"value": "United Kingdom"
}
],
"latitude": "53.310",
"longitude": "-4.636",
"population": "0",
"region": [
{
"value": "Isle of Anglesey"
}
],
"weatherUrl": [
{
"value": ""
}
]
}
],
"request": [
{
"query": "Lat 53.31 and Lon -4.63",
"type": "LatLon"
}
],
"weather": [
{
"astronomy": [
{
"moon_illumination": "10",
"moon_phase": "Waxing Crescent",
"moonrise": "08:44 AM",
"moonset": "10:20 PM",
"sunrise": "07:20 AM",
"sunset": "05:44 PM"
}
],
"avgtempC": "6",
"avgtempF": "43",
"date": "2023-02-23",
"hourly": [
{
"DewPointC": "3",
"DewPointF": "37",
"FeelsLikeC": "2",
"FeelsLikeF": "35",
"HeatIndexC": "6",
"HeatIndexF": "43",
"WindChillC": "2",
"WindChillF": "35",
"WindGustKmph": "46",
"WindGustMiles": "29",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "91",
"chanceofrain": "80",
"chanceofremdry": "0",
"chanceofsnow": "0",
"chanceofsunshine": "0",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "86",
"humidity": "79",
"precipInches": "0.0",
"precipMM": "0.5",
"pressure": "1020",
"pressureInches": "30",
"tempC": "6",
"tempF": "43",
"time": "0",
"uvIndex": "1",
"visibility": "9",
"visibilityMiles": "5",
"weatherCode": "176",
"weatherDesc": [
{
"value": "Patchy rain possible"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NNE",
"winddirDegree": "17",
"windspeedKmph": "29",
"windspeedMiles": "18"
},
{
"DewPointC": "2",
"DewPointF": "36",
"FeelsLikeC": "1",
"FeelsLikeF": "33",
"HeatIndexC": "6",
"HeatIndexF": "42",
"WindChillC": "1",
"WindChillF": "33",
"WindGustKmph": "47",
"WindGustMiles": "29",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "81",
"chanceofrain": "0",
"chanceofremdry": "89",
"chanceofsnow": "0",
"chanceofsunshine": "15",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "63",
"humidity": "78",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1021",
"pressureInches": "30",
"tempC": "6",
"tempF": "42",
"time": "300",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "119",
"weatherDesc": [
{
"value": "Cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NNE",
"winddirDegree": "22",
"windspeedKmph": "31",
"windspeedMiles": "19"
},
{
"DewPointC": "1",
"DewPointF": "35",
"FeelsLikeC": "1",
"FeelsLikeF": "33",
"HeatIndexC": "5",
"HeatIndexF": "41",
"WindChillC": "1",
"WindChillF": "33",
"WindGustKmph": "35",
"WindGustMiles": "22",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "49",
"chanceofrain": "0",
"chanceofremdry": "88",
"chanceofsnow": "0",
"chanceofsunshine": "80",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "45",
"humidity": "78",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1023",
"pressureInches": "30",
"tempC": "5",
"tempF": "41",
"time": "600",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NNE",
"winddirDegree": "19",
"windspeedKmph": "22",
"windspeedMiles": "13"
},
{
"DewPointC": "1",
"DewPointF": "33",
"FeelsLikeC": "2",
"FeelsLikeF": "35",
"HeatIndexC": "5",
"HeatIndexF": "41",
"WindChillC": "2",
"WindChillF": "35",
"WindGustKmph": "24",
"WindGustMiles": "15",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "0",
"chanceofrain": "0",
"chanceofremdry": "80",
"chanceofsnow": "0",
"chanceofsunshine": "88",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "0",
"humidity": "73",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1024",
"pressureInches": "30",
"tempC": "5",
"tempF": "41",
"time": "900",
"uvIndex": "3",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "113",
"weatherDesc": [
{
"value": "Sunny"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NNE",
"winddirDegree": "23",
"windspeedKmph": "16",
"windspeedMiles": "10"
},
{
"DewPointC": "-1",
"DewPointF": "31",
"FeelsLikeC": "5",
"FeelsLikeF": "40",
"HeatIndexC": "7",
"HeatIndexF": "45",
"WindChillC": "5",
"WindChillF": "40",
"WindGustKmph": "18",
"WindGustMiles": "11",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "0",
"chanceofrain": "0",
"chanceofremdry": "82",
"chanceofsnow": "0",
"chanceofsunshine": "94",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "8",
"humidity": "57",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1024",
"pressureInches": "30",
"tempC": "7",
"tempF": "45",
"time": "1200",
"uvIndex": "3",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "113",
"weatherDesc": [
{
"value": "Sunny"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "N",
"winddirDegree": "7",
"windspeedKmph": "15",
"windspeedMiles": "10"
},
{
"DewPointC": "1",
"DewPointF": "33",
"FeelsLikeC": "4",
"FeelsLikeF": "39",
"HeatIndexC": "7",
"HeatIndexF": "45",
"WindChillC": "4",
"WindChillF": "39",
"WindGustKmph": "26",
"WindGustMiles": "16",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "41",
"chanceofrain": "0",
"chanceofremdry": "85",
"chanceofsnow": "0",
"chanceofsunshine": "71",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "29",
"humidity": "63",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1023",
"pressureInches": "30",
"tempC": "7",
"tempF": "45",
"time": "1500",
"uvIndex": "3",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "N",
"winddirDegree": "1",
"windspeedKmph": "21",
"windspeedMiles": "13"
},
{
"DewPointC": "3",
"DewPointF": "37",
"FeelsLikeC": "4",
"FeelsLikeF": "39",
"HeatIndexC": "6",
"HeatIndexF": "43",
"WindChillC": "4",
"WindChillF": "39",
"WindGustKmph": "16",
"WindGustMiles": "10",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "30",
"chanceofrain": "0",
"chanceofremdry": "85",
"chanceofsnow": "0",
"chanceofsunshine": "76",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "51",
"humidity": "78",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1023",
"pressureInches": "30",
"tempC": "6",
"tempF": "43",
"time": "1800",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NNW",
"winddirDegree": "344",
"windspeedKmph": "10",
"windspeedMiles": "6"
},
{
"DewPointC": "2",
"DewPointF": "36",
"FeelsLikeC": "4",
"FeelsLikeF": "40",
"HeatIndexC": "6",
"HeatIndexF": "43",
"WindChillC": "4",
"WindChillF": "40",
"WindGustKmph": "14",
"WindGustMiles": "9",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "88",
"chanceofrain": "0",
"chanceofremdry": "87",
"chanceofsnow": "0",
"chanceofsunshine": "19",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "88",
"humidity": "77",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1022",
"pressureInches": "30",
"tempC": "6",
"tempF": "43",
"time": "2100",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "122",
"weatherDesc": [
{
"value": "Overcast"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "WSW",
"winddirDegree": "238",
"windspeedKmph": "8",
"windspeedMiles": "5"
}
],
"maxtempC": "8",
"maxtempF": "46",
"mintempC": "4",
"mintempF": "40",
"sunHour": "10.0",
"totalSnow_cm": "0.0",
"uvIndex": "2"
},
{
"astronomy": [
{
"moon_illumination": "18",
"moon_phase": "Waxing Crescent",
"moonrise": "08:56 AM",
"moonset": "11:45 PM",
"sunrise": "07:18 AM",
"sunset": "05:46 PM"
}
],
"avgtempC": "8",
"avgtempF": "46",
"date": "2023-02-24",
"hourly": [
{
"DewPointC": "5",
"DewPointF": "42",
"FeelsLikeC": "4",
"FeelsLikeF": "40",
"HeatIndexC": "7",
"HeatIndexF": "45",
"WindChillC": "4",
"WindChillF": "40",
"WindGustKmph": "26",
"WindGustMiles": "16",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "94",
"chanceofrain": "82",
"chanceofremdry": "0",
"chanceofsnow": "0",
"chanceofsunshine": "0",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "100",
"humidity": "87",
"precipInches": "0.0",
"precipMM": "0.1",
"pressure": "1020",
"pressureInches": "30",
"tempC": "7",
"tempF": "45",
"time": "0",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "176",
"weatherDesc": [
{
"value": "Patchy rain possible"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NW",
"winddirDegree": "305",
"windspeedKmph": "17",
"windspeedMiles": "10"
},
{
"DewPointC": "6",
"DewPointF": "42",
"FeelsLikeC": "4",
"FeelsLikeF": "39",
"HeatIndexC": "7",
"HeatIndexF": "45",
"WindChillC": "4",
"WindChillF": "39",
"WindGustKmph": "30",
"WindGustMiles": "18",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "92",
"chanceofrain": "84",
"chanceofremdry": "0",
"chanceofsnow": "0",
"chanceofsunshine": "0",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "95",
"humidity": "90",
"precipInches": "0.0",
"precipMM": "0.2",
"pressure": "1019",
"pressureInches": "30",
"tempC": "7",
"tempF": "45",
"time": "300",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "353",
"weatherDesc": [
{
"value": "Light rain shower"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NW",
"winddirDegree": "306",
"windspeedKmph": "19",
"windspeedMiles": "12"
},
{
"DewPointC": "6",
"DewPointF": "42",
"FeelsLikeC": "4",
"FeelsLikeF": "38",
"HeatIndexC": "8",
"HeatIndexF": "46",
"WindChillC": "4",
"WindChillF": "38",
"WindGustKmph": "40",
"WindGustMiles": "25",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "87",
"chanceofrain": "72",
"chanceofremdry": "0",
"chanceofsnow": "0",
"chanceofsunshine": "0",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "100",
"humidity": "89",
"precipInches": "0.0",
"precipMM": "0.2",
"pressure": "1017",
"pressureInches": "30",
"tempC": "8",
"tempF": "46",
"time": "600",
"uvIndex": "1",
"visibility": "2",
"visibilityMiles": "1",
"weatherCode": "266",
"weatherDesc": [
{
"value": "Light drizzle"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NW",
"winddirDegree": "312",
"windspeedKmph": "27",
"windspeedMiles": "17"
},
{
"DewPointC": "7",
"DewPointF": "44",
"FeelsLikeC": "5",
"FeelsLikeF": "40",
"HeatIndexC": "8",
"HeatIndexF": "47",
"WindChillC": "5",
"WindChillF": "40",
"WindGustKmph": "40",
"WindGustMiles": "25",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "86",
"chanceofrain": "84",
"chanceofremdry": "0",
"chanceofsnow": "0",
"chanceofsunshine": "0",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "100",
"humidity": "89",
"precipInches": "0.0",
"precipMM": "0.2",
"pressure": "1016",
"pressureInches": "30",
"tempC": "8",
"tempF": "47",
"time": "900",
"uvIndex": "2",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "353",
"weatherDesc": [
{
"value": "Light rain shower"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NNW",
"winddirDegree": "331",
"windspeedKmph": "27",
"windspeedMiles": "17"
},
{
"DewPointC": "7",
"DewPointF": "45",
"FeelsLikeC": "6",
"FeelsLikeF": "42",
"HeatIndexC": "10",
"HeatIndexF": "49",
"WindChillC": "6",
"WindChillF": "42",
"WindGustKmph": "42",
"WindGustMiles": "26",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "92",
"chanceofrain": "54",
"chanceofremdry": "0",
"chanceofsnow": "0",
"chanceofsunshine": "0",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "92",
"humidity": "86",
"precipInches": "0.0",
"precipMM": "0.5",
"pressure": "1015",
"pressureInches": "30",
"tempC": "10",
"tempF": "49",
"time": "1200",
"uvIndex": "2",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "353",
"weatherDesc": [
{
"value": "Light rain shower"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NNW",
"winddirDegree": "342",
"windspeedKmph": "33",
"windspeedMiles": "20"
},
{
"DewPointC": "6",
"DewPointF": "43",
"FeelsLikeC": "7",
"FeelsLikeF": "44",
"HeatIndexC": "10",
"HeatIndexF": "49",
"WindChillC": "7",
"WindChillF": "44",
"WindGustKmph": "32",
"WindGustMiles": "20",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "85",
"chanceofrain": "62",
"chanceofremdry": "0",
"chanceofsnow": "0",
"chanceofsunshine": "0",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "75",
"humidity": "78",
"precipInches": "0.0",
"precipMM": "0.4",
"pressure": "1014",
"pressureInches": "30",
"tempC": "10",
"tempF": "49",
"time": "1500",
"uvIndex": "2",
"visibility": "9",
"visibilityMiles": "5",
"weatherCode": "176",
"weatherDesc": [
{
"value": "Patchy rain possible"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "N",
"winddirDegree": "11",
"windspeedKmph": "25",
"windspeedMiles": "15"
},
{
"DewPointC": "4",
"DewPointF": "40",
"FeelsLikeC": "5",
"FeelsLikeF": "40",
"HeatIndexC": "8",
"HeatIndexF": "46",
"WindChillC": "5",
"WindChillF": "40",
"WindGustKmph": "26",
"WindGustMiles": "16",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "84",
"chanceofrain": "70",
"chanceofremdry": "0",
"chanceofsnow": "0",
"chanceofsunshine": "0",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "57",
"humidity": "81",
"precipInches": "0.0",
"precipMM": "0.4",
"pressure": "1016",
"pressureInches": "30",
"tempC": "8",
"tempF": "46",
"time": "1800",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "353",
"weatherDesc": [
{
"value": "Light rain shower"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NE",
"winddirDegree": "51",
"windspeedKmph": "16",
"windspeedMiles": "10"
},
{
"DewPointC": "2",
"DewPointF": "36",
"FeelsLikeC": "2",
"FeelsLikeF": "35",
"HeatIndexC": "6",
"HeatIndexF": "42",
"WindChillC": "2",
"WindChillF": "35",
"WindGustKmph": "32",
"WindGustMiles": "20",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "49",
"chanceofrain": "0",
"chanceofremdry": "94",
"chanceofsnow": "0",
"chanceofsunshine": "83",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "48",
"humidity": "78",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1018",
"pressureInches": "30",
"tempC": "6",
"tempF": "42",
"time": "2100",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "ENE",
"winddirDegree": "74",
"windspeedKmph": "19",
"windspeedMiles": "12"
}
],
"maxtempC": "10",
"maxtempF": "49",
"mintempC": "5",
"mintempF": "41",
"sunHour": "8.0",
"totalSnow_cm": "0.0",
"uvIndex": "2"
},
{
"astronomy": [
{
"moon_illumination": "27",
"moon_phase": "Waxing Crescent",
"moonrise": "09:09 AM",
"moonset": "No moonset",
"sunrise": "07:16 AM",
"sunset": "05:48 PM"
}
],
"avgtempC": "5",
"avgtempF": "40",
"date": "2023-02-25",
"hourly": [
{
"DewPointC": "0",
"DewPointF": "33",
"FeelsLikeC": "0",
"FeelsLikeF": "32",
"HeatIndexC": "4",
"HeatIndexF": "40",
"WindChillC": "0",
"WindChillF": "32",
"WindGustKmph": "33",
"WindGustMiles": "21",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "0",
"chanceofrain": "0",
"chanceofremdry": "92",
"chanceofsnow": "0",
"chanceofsunshine": "86",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "4",
"humidity": "75",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1019",
"pressureInches": "30",
"tempC": "4",
"tempF": "40",
"time": "0",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "113",
"weatherDesc": [
{
"value": "Clear"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "ENE",
"winddirDegree": "67",
"windspeedKmph": "20",
"windspeedMiles": "13"
},
{
"DewPointC": "-1",
"DewPointF": "30",
"FeelsLikeC": "-1",
"FeelsLikeF": "31",
"HeatIndexC": "3",
"HeatIndexF": "38",
"WindChillC": "-1",
"WindChillF": "31",
"WindGustKmph": "27",
"WindGustMiles": "17",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "0",
"chanceofrain": "0",
"chanceofremdry": "86",
"chanceofsnow": "0",
"chanceofsunshine": "85",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "0",
"humidity": "74",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1020",
"pressureInches": "30",
"tempC": "3",
"tempF": "38",
"time": "300",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "113",
"weatherDesc": [
{
"value": "Clear"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "ENE",
"winddirDegree": "60",
"windspeedKmph": "15",
"windspeedMiles": "9"
},
{
"DewPointC": "-1",
"DewPointF": "30",
"FeelsLikeC": "-1",
"FeelsLikeF": "31",
"HeatIndexC": "3",
"HeatIndexF": "37",
"WindChillC": "-1",
"WindChillF": "31",
"WindGustKmph": "26",
"WindGustMiles": "16",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "40",
"chanceofrain": "0",
"chanceofremdry": "87",
"chanceofsnow": "0",
"chanceofsunshine": "82",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "44",
"humidity": "76",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1021",
"pressureInches": "30",
"tempC": "3",
"tempF": "37",
"time": "600",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NE",
"winddirDegree": "48",
"windspeedKmph": "15",
"windspeedMiles": "9"
},
{
"DewPointC": "0",
"DewPointF": "32",
"FeelsLikeC": "1",
"FeelsLikeF": "33",
"HeatIndexC": "5",
"HeatIndexF": "40",
"WindChillC": "1",
"WindChillF": "33",
"WindGustKmph": "27",
"WindGustMiles": "17",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "32",
"chanceofrain": "0",
"chanceofremdry": "87",
"chanceofsnow": "0",
"chanceofsunshine": "79",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "28",
"humidity": "72",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1021",
"pressureInches": "30",
"tempC": "5",
"tempF": "40",
"time": "900",
"uvIndex": "2",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NE",
"winddirDegree": "47",
"windspeedKmph": "19",
"windspeedMiles": "12"
},
{
"DewPointC": "-0",
"DewPointF": "31",
"FeelsLikeC": "2",
"FeelsLikeF": "36",
"HeatIndexC": "6",
"HeatIndexF": "43",
"WindChillC": "2",
"WindChillF": "36",
"WindGustKmph": "30",
"WindGustMiles": "19",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "35",
"chanceofrain": "0",
"chanceofremdry": "80",
"chanceofsnow": "0",
"chanceofsunshine": "72",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "49",
"humidity": "63",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1022",
"pressureInches": "30",
"tempC": "6",
"tempF": "43",
"time": "1200",
"uvIndex": "3",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NE",
"winddirDegree": "49",
"windspeedKmph": "26",
"windspeedMiles": "16"
},
{
"DewPointC": "0",
"DewPointF": "32",
"FeelsLikeC": "2",
"FeelsLikeF": "35",
"HeatIndexC": "6",
"HeatIndexF": "43",
"WindChillC": "2",
"WindChillF": "35",
"WindGustKmph": "33",
"WindGustMiles": "21",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "80",
"chanceofrain": "0",
"chanceofremdry": "80",
"chanceofsnow": "0",
"chanceofsunshine": "17",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "77",
"humidity": "66",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1021",
"pressureInches": "30",
"tempC": "6",
"tempF": "43",
"time": "1500",
"uvIndex": "2",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "119",
"weatherDesc": [
{
"value": "Cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NE",
"winddirDegree": "43",
"windspeedKmph": "27",
"windspeedMiles": "17"
},
{
"DewPointC": "1",
"DewPointF": "33",
"FeelsLikeC": "1",
"FeelsLikeF": "34",
"HeatIndexC": "5",
"HeatIndexF": "42",
"WindChillC": "1",
"WindChillF": "34",
"WindGustKmph": "35",
"WindGustMiles": "22",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "36",
"chanceofrain": "0",
"chanceofremdry": "84",
"chanceofsnow": "0",
"chanceofsunshine": "81",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "38",
"humidity": "71",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1022",
"pressureInches": "30",
"tempC": "5",
"tempF": "42",
"time": "1800",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "116",
"weatherDesc": [
{
"value": "Partly cloudy"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "NE",
"winddirDegree": "39",
"windspeedKmph": "25",
"windspeedMiles": "15"
},
{
"DewPointC": "-1",
"DewPointF": "31",
"FeelsLikeC": "0",
"FeelsLikeF": "32",
"HeatIndexC": "5",
"HeatIndexF": "40",
"WindChillC": "0",
"WindChillF": "32",
"WindGustKmph": "37",
"WindGustMiles": "23",
"chanceoffog": "0",
"chanceoffrost": "0",
"chanceofhightemp": "0",
"chanceofovercast": "0",
"chanceofrain": "0",
"chanceofremdry": "90",
"chanceofsnow": "0",
"chanceofsunshine": "93",
"chanceofthunder": "0",
"chanceofwindy": "0",
"cloudcover": "12",
"humidity": "69",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "1023",
"pressureInches": "30",
"tempC": "5",
"tempF": "40",
"time": "2100",
"uvIndex": "1",
"visibility": "10",
"visibilityMiles": "6",
"weatherCode": "113",
"weatherDesc": [
{
"value": "Clear"
}
],
"weatherIconUrl": [
{
"value": ""
}
],
"winddir16Point": "ENE",
"winddirDegree": "64",
"windspeedKmph": "24",
"windspeedMiles": "15"
}
],
"maxtempC": "6",
"maxtempF": "43",
"mintempC": "3",
"mintempF": "37",
"sunHour": "9.3",
"totalSnow_cm": "0.0",
"uvIndex": "2"
}
]
}
const weatherCodes = {
"113": "Sunny",
"116": "PartlyCloudy",
"119": "Cloudy",
"122": "VeryCloudy",
"143": "Fog",
"176": "LightShowers",
"179": "LightSleetShowers",
"182": "LightSleet",
"185": "LightSleet",
"200": "ThunderyShowers",
"227": "LightSnow",
"230": "HeavySnow",
"248": "Fog",
"260": "Fog",
"263": "LightShowers",
"266": "LightRain",
"281": "LightSleet",
"284": "LightSleet",
"293": "LightRain",
"296": "LightRain",
"299": "HeavyShowers",
"302": "HeavyRain",
"305": "HeavyShowers",
"308": "HeavyRain",
"311": "LightSleet",
"314": "LightSleet",
"317": "LightSleet",
"320": "LightSnow",
"323": "LightSnowShowers",
"326": "LightSnowShowers",
"329": "HeavySnow",
"332": "HeavySnow",
"335": "HeavySnowShowers",
"338": "HeavySnow",
"350": "LightSleet",
"353": "LightShowers",
"356": "HeavyShowers",
"359": "HeavyRain",
"362": "LightSleetShowers",
"365": "LightSleetShowers",
"368": "LightSnowShowers",
"371": "HeavySnowShowers",
"374": "LightSleetShowers",
"377": "LightSleet",
"386": "ThunderyShowers",
"389": "ThunderyHeavyRain",
"392": "ThunderySnowShowers",
"395": "HeavySnowShowers",
}
const weatherSymbols = {
"Unknown": "✨",
"Cloudy": "☁️",
"Fog": "🌫",
"HeavyRain": "🌧",
"HeavyShowers": "🌧",
"HeavySnow": "❄️",
"HeavySnowShowers": "❄️",
"LightRain": "🌦",
"LightShowers": "🌦",
"LightSleet": "🌧",
"LightSleetShowers": "🌧",
"LightSnow": "🌨",
"LightSnowShowers": "🌨",
"PartlyCloudy": "⛅️",
"Sunny": "☀️",
"ThunderyHeavyRain": "🌩",
"ThunderyShowers": "⛈",
"ThunderySnowShowers": "⛈",
"VeryCloudy": "☁️",
}
const wcs = (wc) => weatherSymbols[weatherCodes[wc]];
let name = data.nearest_area[0].areaName[0].value;
let cc = data.current_condition[0];
let wc = data.current_condition[0].weatherCode;
let day1m = data.weather[0].hourly[3];
let day1n = data.weather[0].hourly[4];
let day1e = data.weather[0].hourly[6];
let day1mstr = `${day1m.tempC}/${day1m.FeelsLikeC}/${day1m.WindChillC}°C ${wcs(day1m.weatherCode)} ${day1m.chanceofrain}% ${day1m.windspeedMiles}mph/${day1m.winddir16Point}`;
let day1nstr = `${day1n.tempC}/${day1n.FeelsLikeC}/${day1n.WindChillC}°C ${wcs(day1n.weatherCode)} ${day1n.chanceofrain}% ${day1n.windspeedMiles}mph/${day1n.winddir16Point}`;
let day1estr = `${day1e.tempC}/${day1e.FeelsLikeC}/${day1e.WindChillC}°C ${wcs(day1e.weatherCode)} ${day1e.chanceofrain}% ${day1e.windspeedMiles}mph/${day1e.winddir16Point}`;
let day1str = `${day1mstr}, ${day1nstr}, ${day1estr}`;
let day2m = data.weather[1].hourly[3];
let day2n = data.weather[1].hourly[4];
let day2e = data.weather[1].hourly[6];
let day2mstr = `${day2m.tempC}/${day2m.FeelsLikeC}/${day2m.WindChillC}°C ${wcs(day2m.weatherCode)} ${day2m.chanceofrain}% ${day2m.windspeedMiles}mph/${day2m.winddir16Point}`;
let day2nstr = `${day2n.tempC}/${day2n.FeelsLikeC}/${day2n.WindChillC}°C ${wcs(day2n.weatherCode)} ${day2n.chanceofrain}% ${day2n.windspeedMiles}mph/${day2n.winddir16Point}`;
let day2estr = `${day2e.tempC}/${day2e.FeelsLikeC}/${day2e.WindChillC}°C ${wcs(day2e.weatherCode)} ${day2e.chanceofrain}% ${day2e.windspeedMiles}mph/${day2e.winddir16Point}`;
let day2str = `${day2mstr}, ${day2nstr}, ${day2estr}`;
let day3m = data.weather[2].hourly[3];
let day3n = data.weather[2].hourly[4];
let day3e = data.weather[2].hourly[6];
let day3mstr = `${day3m.tempC}/${day3m.FeelsLikeC}/${day3m.WindChillC}°C ${wcs(day3m.weatherCode)} ${day3m.chanceofrain}% ${day3m.windspeedMiles}mph/${day3m.winddir16Point}`;
let day3nstr = `${day3n.tempC}/${day3n.FeelsLikeC}/${day3n.WindChillC}°C ${wcs(day3n.weatherCode)} ${day3n.chanceofrain}% ${day3n.windspeedMiles}mph/${day3n.winddir16Point}`;
let day3estr = `${day3e.tempC}/${day3e.FeelsLikeC}/${day3e.WindChillC}°C ${wcs(day3e.weatherCode)} ${day3e.chanceofrain}% ${day3e.windspeedMiles}mph/${day3e.winddir16Point}`;
let day3str = `${day3mstr}, ${day3nstr}, ${day3estr}`;
let str2 = `${day1str}
${day2str}`;
console.log(str2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment