[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Garbled up html output
From: |
Pankaj Jangid |
Subject: |
Re: Garbled up html output |
Date: |
Mon, 23 Nov 2020 08:14:16 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) |
Partha Pratim Ghosh <ghosh.parthapratim.unisa@gmail.com> writes:
> I tried to run your script from .emacs file.
>
> After this I tried _M-x wttrin_ and it returned the error: wrong
> argument type listp: "en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4"
My changes were not for .emacs file. You will have to replace functions
in the package. Somewhere in your **/elpa/wttrin.el. And remove the
compiled version (.elc). This is just a workaround till you get update
from MELPA.
> Please can you suugest further changes and/help...
The below var and func are already defined in wttrin.el. You just have to
replace them with the code below.
>> #+begin_src emacs-lisp
>> (defcustom wttrin-default-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-user-agent "curl")
>> (url-mime-language-string wttrin-default-accept-language))
>> (with-current-buffer
>> (url-retrieve-synchronously
>> (concat "http://wttr.in/" query)
>> (lambda (status) (switch-to-buffer (current-buffer))))
>> (decode-coding-string (buffer-string) 'utf-8))))
>> #+end_src