From 64b03b5e72d2c0d8b2c42ecbb65f4336fe733781 Mon Sep 17 00:00:00 2001 From: Stephen Jianu Date: Sun, 30 Mar 2025 10:38:29 -0500 Subject: [PATCH] Swap weather icons to FOSS ones by Erik Flowers --- .gitmodules | 3 ++ README.md | 4 +- descriptions.json | 114 +++++++++++++++++++++++----------------------- index.php | 7 ++- weather-icons | 1 + 5 files changed, 69 insertions(+), 60 deletions(-) create mode 100644 .gitmodules create mode 160000 weather-icons diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ea9d4d5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "weather-icons"] + path = weather-icons + url = https://github.com/erikflowers/weather-icons diff --git a/README.md b/README.md index 2027c4e..78cc4ef 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,6 @@ docker run -d -p 6969:80 --restart=unless-stopped --name reasonableweather regis ``` ### Credits -This site uses the excellent [Open-Meteo API](https://open-meteo.com/) as well as a [JSON mapping of weather codes by GitHub user stellasphere](https://gist.github.com/stellasphere/9490c195ed2b53c707087c8c2db4ec0c). +* [Open-Meteo API](https://open-meteo.com/) +* [JSON mapping of weather codes by GitHub user stellasphere](https://gist.github.com/stellasphere/9490c195ed2b53c707087c8c2db4ec0c) +* [Weather Icons by Erik Flowers](https://github.com/erikflowers/weather-icons/) diff --git a/descriptions.json b/descriptions.json index 8ca1587..8eb07bd 100644 --- a/descriptions.json +++ b/descriptions.json @@ -2,281 +2,281 @@ "0":{ "day":{ "description":"Sunny", - "image":"http://openweathermap.org/img/wn/01d@2x.png" + "image":"wi-day-sunny" }, "night":{ "description":"Clear", - "image":"http://openweathermap.org/img/wn/01n@2x.png" + "image":"wi-night-clear" } }, "1":{ "day":{ "description":"Mainly Sunny", - "image":"http://openweathermap.org/img/wn/01d@2x.png" + "image":"wi-day-sunny" }, "night":{ "description":"Mainly Clear", - "image":"http://openweathermap.org/img/wn/01n@2x.png" + "image":"wi-night-clear" } }, "2":{ "day":{ "description":"Partly Cloudy", - "image":"http://openweathermap.org/img/wn/02d@2x.png" + "image":"wi-night-partly-cloudy" }, "night":{ "description":"Partly Cloudy", - "image":"http://openweathermap.org/img/wn/02n@2x.png" + "image":"wi-night-partly-cloudy" } }, "3":{ "day":{ "description":"Cloudy", - "image":"http://openweathermap.org/img/wn/03d@2x.png" + "image":"wi-day-cloudy" }, "night":{ "description":"Cloudy", - "image":"http://openweathermap.org/img/wn/03n@2x.png" + "image":"wi-night-cloudy" } }, "45":{ "day":{ "description":"Foggy", - "image":"http://openweathermap.org/img/wn/50d@2x.png" + "image":"wi-day-fog" }, "night":{ "description":"Foggy", - "image":"http://openweathermap.org/img/wn/50n@2x.png" + "image":"wi-night-fog" } }, "48":{ "day":{ "description":"Rime Fog", - "image":"http://openweathermap.org/img/wn/50d@2x.png" + "image":"wi-day-fog" }, "night":{ "description":"Rime Fog", - "image":"http://openweathermap.org/img/wn/50n@2x.png" + "image":"wi-night-fog" } }, "51":{ "day":{ "description":"Light Drizzle", - "image":"http://openweathermap.org/img/wn/09d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Light Drizzle", - "image":"http://openweathermap.org/img/wn/09n@2x.png" + "image":"wi-night-rain" } }, "53":{ "day":{ "description":"Drizzle", - "image":"http://openweathermap.org/img/wn/09d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Drizzle", - "image":"http://openweathermap.org/img/wn/09n@2x.png" + "image":"wi-night-rain" } }, "55":{ "day":{ "description":"Heavy Drizzle", - "image":"http://openweathermap.org/img/wn/09d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Heavy Drizzle", - "image":"http://openweathermap.org/img/wn/09n@2x.png" + "image":"wi-night-rain" } }, "56":{ "day":{ "description":"Light Freezing Drizzle", - "image":"http://openweathermap.org/img/wn/09d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Light Freezing Drizzle", - "image":"http://openweathermap.org/img/wn/09n@2x.png" + "image":"wi-night-rain" } }, "57":{ "day":{ "description":"Freezing Drizzle", - "image":"http://openweathermap.org/img/wn/09d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Freezing Drizzle", - "image":"http://openweathermap.org/img/wn/09n@2x.png" + "image":"wi-night-rain" } }, "61":{ "day":{ "description":"Light Rain", - "image":"http://openweathermap.org/img/wn/10d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Light Rain", - "image":"http://openweathermap.org/img/wn/10n@2x.png" + "image":"wi-night-rain" } }, "63":{ "day":{ "description":"Rain", - "image":"http://openweathermap.org/img/wn/10d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Rain", - "image":"http://openweathermap.org/img/wn/10n@2x.png" + "image":"wi-night-rain" } }, "65":{ "day":{ "description":"Heavy Rain", - "image":"http://openweathermap.org/img/wn/10d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Heavy Rain", - "image":"http://openweathermap.org/img/wn/10n@2x.png" + "image":"wi-night-rain" } }, "66":{ "day":{ "description":"Light Freezing Rain", - "image":"http://openweathermap.org/img/wn/10d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Light Freezing Rain", - "image":"http://openweathermap.org/img/wn/10n@2x.png" + "image":"wi-night-rain" } }, "67":{ "day":{ "description":"Freezing Rain", - "image":"http://openweathermap.org/img/wn/10d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Freezing Rain", - "image":"http://openweathermap.org/img/wn/10n@2x.png" + "image":"wi-night-rain" } }, "71":{ "day":{ "description":"Light Snow", - "image":"http://openweathermap.org/img/wn/13d@2x.png" + "image":"wi-day-snow" }, "night":{ "description":"Light Snow", - "image":"http://openweathermap.org/img/wn/13n@2x.png" + "image":"wi-night-snow" } }, "73":{ "day":{ "description":"Snow", - "image":"http://openweathermap.org/img/wn/13d@2x.png" + "image":"wi-day-snow" }, "night":{ "description":"Snow", - "image":"http://openweathermap.org/img/wn/13n@2x.png" + "image":"wi-night-snow" } }, "75":{ "day":{ "description":"Heavy Snow", - "image":"http://openweathermap.org/img/wn/13d@2x.png" + "image":"wi-day-snow" }, "night":{ "description":"Heavy Snow", - "image":"http://openweathermap.org/img/wn/13n@2x.png" + "image":"wi-night-snow" } }, "77":{ "day":{ "description":"Snow Grains", - "image":"http://openweathermap.org/img/wn/13d@2x.png" + "image":"wi-day-snow" }, "night":{ "description":"Snow Grains", - "image":"http://openweathermap.org/img/wn/13n@2x.png" + "image":"wi-night-snow" } }, "80":{ "day":{ "description":"Light Showers", - "image":"http://openweathermap.org/img/wn/09d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Light Showers", - "image":"http://openweathermap.org/img/wn/09n@2x.png" + "image":"wi-night-rain" } }, "81":{ "day":{ "description":"Showers", - "image":"http://openweathermap.org/img/wn/09d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Showers", - "image":"http://openweathermap.org/img/wn/09n@2x.png" + "image":"wi-night-rain" } }, "82":{ "day":{ "description":"Heavy Showers", - "image":"http://openweathermap.org/img/wn/09d@2x.png" + "image":"wi-day-rain" }, "night":{ "description":"Heavy Showers", - "image":"http://openweathermap.org/img/wn/09n@2x.png" + "image":"wi-night-rain" } }, "85":{ "day":{ "description":"Light Snow Showers", - "image":"http://openweathermap.org/img/wn/13d@2x.png" + "image":"wi-day-snow" }, "night":{ "description":"Light Snow Showers", - "image":"http://openweathermap.org/img/wn/13n@2x.png" + "image":"wi-night-snow" } }, "86":{ "day":{ "description":"Snow Showers", - "image":"http://openweathermap.org/img/wn/13d@2x.png" + "image":"wi-day-snow" }, "night":{ "description":"Snow Showers", - "image":"http://openweathermap.org/img/wn/13n@2x.png" + "image":"wi-night-snow" } }, "95":{ "day":{ "description":"Thunderstorm", - "image":"http://openweathermap.org/img/wn/11d@2x.png" + "image":"wi-day-thunderstorm" }, "night":{ "description":"Thunderstorm", - "image":"http://openweathermap.org/img/wn/11n@2x.png" + "image":"wi-night-thunderstorm" } }, "96":{ "day":{ "description":"Light Thunderstorms With Hail", - "image":"http://openweathermap.org/img/wn/11d@2x.png" + "image":"wi-day-thunderstorm" }, "night":{ "description":"Light Thunderstorms With Hail", - "image":"http://openweathermap.org/img/wn/11n@2x.png" + "image":"wi-night-thunderstorm" } }, "99":{ "day":{ "description":"Thunderstorm With Hail", - "image":"http://openweathermap.org/img/wn/11d@2x.png" + "image":"wi-day-thunderstorm" }, "night":{ "description":"Thunderstorm With Hail", - "image":"http://openweathermap.org/img/wn/11n@2x.png" + "image":"wi-night-thunderstorm" } } -} \ No newline at end of file +} diff --git a/index.php b/index.php index 0499324..74af5ea 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,7 @@ \n"; echo "\n"; + echo ""; echo "\n"; echo "Weather in Park Ridge\n"; echo "\n"; @@ -14,7 +15,7 @@ $isDay = ($json["current"]["is_day"]) ? "day" : "night"; $description = $jsonDescriptions[$code][$isDay]["description"]; $image = $jsonDescriptions[$code][$isDay]["image"]; - echo "
".$description."
".floor($json["current"]["temperature_2m"])."° F\n"; + echo "
".$description."
".floor($json["current"]["temperature_2m"])."° F\n"; echo "\n"; echo "

Your 7 day forecast for Park Ridge is:

\n"; for ($i = 0; $i < 7; $i++) { @@ -28,7 +29,7 @@ $precipSum = $json["daily"]["precipitation_sum"][$i]; echo "
\n"; echo "

\n"; - echo "".date('l', strtotime($json["daily"]["time"][$i]))."
\n"; + echo "".date('l', strtotime($json["daily"]["time"][$i]))."
\n"; echo "

\n"; echo "".$description."
\n"; echo "High: ".$tempHigh."° F\n"; @@ -42,6 +43,8 @@ } echo "

\n"; echo "Weather data by Open-Meteo.com\n"; + echo "
\n"; + echo "Icons by Erik Flowers\n"; echo "\n"; echo "\n"; ?> diff --git a/weather-icons b/weather-icons new file mode 160000 index 0000000..bb80982 --- /dev/null +++ b/weather-icons @@ -0,0 +1 @@ +Subproject commit bb80982bf1f43f2d57f9dd753e7413bf88beb9ed -- 2.39.5