OpenWeatherMap
As of March 1, 2021, Yahoo is ending free API access (details on the website). To keep your projects working with free access, you need to replace the Yahoo Weather module script with a new script that works with OpenWeatherMap.
Description
OpenWeatherMap is an online service that provides an API for current weather data, forecasts and historical data. Its data sources include official meteorological services, airport weather stations and private weather stations.
OpenWeatherMap processes the information and uses it to produce weather forecasts and weather maps, such as cloud cover and precipitation maps. The main idea behind OWM is to use private weather stations to improve the accuracy of the source weather information and, consequently, the forecasts.
Integration with the Weather JS module
-
Download the new weather script using this link;
-
Replace the script text in the Weather module in your project with the new script;
-
Enter your key from the openweather website in the OPENWEATHER_KEY variable on the first line of the script. To do this:
3.1. Sign up on the OpenWeatherMap website. After signing up, you will receive an email to confirm your account. Confirm it.
3.2. Follow this link. Your free keys are stored here, and you can generate new keys.
It is recommended to generate a separate key for each new site, because the free API supports 1000 requests per day per key.
- Start the project.
When downloading a graphical interface with the Weather module preinstalled, you need to replace the module script with the following:
-
Consumers - script for graphical interfaces from the website (except Flex);
-
Flex - script for the Flex 2 in 1 interface.
-
For a graphical interface with the Weather module preinstalled, you also need to replace the key in OPENWEATHER_KEY with your own key from openweather
Openweather does not support all the functionality that was available in Yahoo Weather. In particular:
- Yahoo provided 2 types of icons: a minimalist icon and a background icon. OpenWeatherMap provides only one type: a minimalist icon;
- Yahoo returned the Rising tag. Openweather does not provide it, so the script hides all items that displayed this tag.