manifest / integrations / myweather
My Weather REST API endpoint
WordPress plugin that displays weather data at REST API endpoint.
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/salcode/myweather/archive/refs/heads/main.zipWordPress My Weather REST API Plugin
This plugin uses the OpenWeather One Call API 3.0 to retrieve the weather data for a specific latitute/longitude and expose that information at the WordPress REST API endpoint /wp-json/myweather/v1/weather.
The weather data is cached using a WordPress transient.
Setup
In addition to installing and activating this plugin, you'll need to set the following PHP constants (this can be done in wp-config.php at the root of the WordPress site).
SF_MY_WEATHER_API_KEYyour personal API key from openweathermap.orgSF_MY_WEATHER_LATthe latitude of the forecast locationSF_MY_WEATHER_LONthe longitude of the forecast location
e.g.
define('SF_MY_WEATHER_API_KEY', 'abc123abc123abc123');
define('SF_MY_WEATHER_LAT', '38.991581');
define('SF_MY_WEATHER_LON', '-74.814407');