Closed stvharman closed 8 years ago
Hi @stvharman, I assume you try to set org-weather-api-url in your init file?
In that case you have to set the value using setq, because defvar will not override if there is already a value present.
From the emacs documentation[1]:
If the variable already has a value, defvar does not override the existing value.
Simply using setq instead should do the trick:
(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")
Regards, Chris
[1] https://www.gnu.org/software/emacs/manual/html_node/eintr/defvar.html
Thanks! It works. I had to restart emacs though. Simply executing the above and refreshing the Agenda view did not work.
This is an excellent lisp program and I recommend to everyone. It works very well. Some icons and visualization would be very useful. Also, some more explanation on the front page could improve its adoption by orgmode users.
Thanks a lot for your feedback, it is very much appreciated.
For not restarting emacs when changing the configuration (org-weather-refresh) needs to be executed. The webservice results are cached locally to avoid unnecessary calls to the webservice.
Another user already created an issue for adding icons some time ago, see #1. I don't need it personally, so it's not on my TODO list. A pull request would be highly welcome though.
How can you get the temps in Fahrentheit? I tried the below but it did not work. I set the API call parameter to imperial and change the temperature unit.
thanks in advance!
;; Load the org-weather library (add-to-list 'load-path "~/.emacs.d/my-elisp/org-weather") (require 'org-weather) ;; Set your location and refresh the data (defvar org-weather-api-url "http://api.openweathermap.org/data/2.5/forecast/daily?q=%s&mode=json&units=imperial&cnt=7&APPID=%s") (defvar org-weather-temperature-unit "°F") (setq org-weather-api-key "xxxxxxxxxxxxxf") (setq org-weather-location "Baltimore,MD") (org-weather-refresh) (setq org-weather-format "Weather: %desc, %tmin-%tmax%tu, %p%pu, %h%hu, %s%su")