kautsig / org-weather

Weather forecast for the org-mode agenda.
MIT License
28 stars 9 forks source link

https://julien.danjou.info/projects/emacs-packages#google-weather

: 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 "~//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")

** openweather API Key. The [[http://openweathermap.org/api][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:

+BEGIN_QUOTE

All data provided by OpenWeatherMap are distributed under terms of the Creative Commons license http://creativecommons.org/licenses/by-sa/2.0/.

+END_QUOTE

To apply with the license the name "OpenWeatherMap" was added to the string displayed in your agenda.