org-weather is a small elisp script for displaying weather data from openweathermap.org in your org-mode agenda. I wrote this because the existing package is based on the google api which was discontinued:
https://julien.danjou.info/projects/emacs-packages#google-weather
Clone the repository using:
git clone http://github.com/kautsig/org-weather.git
Add this to your .emacs file:
;; Load the org-weather library (add-to-list 'load-path "~/<path-to>/org-weather") (require 'org-weather) ;; Set your location and refresh the data (setq org-weather-location "London,UK") (org-weather-refresh)
You can customize the string displayed in your agenda using this in your .emacs file. For available wildcards have a look at the source (it’s simple).
(setq org-weather-format "Weather: %desc, %tmin-%tmax%tu, %p%pu, %h%hu, %s%su")
Add this to one of your org files:
* Weather %%(org-weather)
When you view your agenda, you should now see the weather for today and the forecast for next week. You can refresh weather data by calling:
M-x org-weather-refresh
If you want to show fahrenheit instead of celsius and MPH instead of m/s, you can add these 3 lines to your emacs configuration:
(setq org-weather-api-url "http://api.openweathermap.org/data/2.5/forecast/daily?q=%s&mode=json&units=imperial&cnt=7&APPID=%s") (setq org-weather-temperature-unit "°F") (setq org-weather-speed-unit "MPH")
The openweather site now requires you to sign up for an API key. You can choose a free key or various paid options. You need to add the API key to your .emacs:
(setq org-weather-api-key "YourAPIKey")
According to http://openweathermap.org/price:
All data provided by OpenWeatherMap are distributed under terms of the Creative Commons license http://creativecommons.org/licenses/by-sa/2.0/.
To apply with the license the name “OpenWeatherMap” was added to the string displayed in your agenda.
I’m not a lisp developer and of course you know how to do better. If so, pull requests are kindly appreciated.