diff options
| author | emacsist <emacsist@qq.com> | 2017-03-22 19:02:05 +0800 |
|---|---|---|
| committer | emacsist <emacsist@qq.com> | 2017-03-22 19:02:05 +0800 |
| commit | 6413be54098833a0f9b26334d0eeb5fc9a191d92 (patch) | |
| tree | 2d26836578e09f5456d929e38e3558d5ed6bdeb7 /wttrin.el | |
| parent | e2a02cc58920a4f34ba01f7015c9e6bfcce51f61 (diff) | |
[add] add HTTP request header: Accept-Language, display different language.
Diffstat (limited to 'wttrin.el')
| -rw-r--r-- | wttrin.el | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -27,9 +27,16 @@ :group 'wttrin :type 'list) +(defcustom wttrin-default-accept-language '("Accept-Language" . "en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4") + "Specify default HTTP request Header for Accept-Language." + :group 'wttrin + :type '(list) + ) + (defun wttrin-fetch-raw-string (query) "Get the weather information based on your QUERY." (let ((url-request-extra-headers '(("User-Agent" . "curl")))) + (add-to-list 'url-request-extra-headers wttrin-default-accept-language) (with-current-buffer (url-retrieve-synchronously (concat "http://wttr.in/" query) |
