unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Pankaj Jangid <pankaj@codeisgreat.org>
To: Partha Pratim Ghosh <ghosh.parthapratim.unisa@gmail.com>
Cc: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Garbled up html output
Date: Mon, 23 Nov 2020 08:14:16 +0530	[thread overview]
Message-ID: <m2wnyceqrj.fsf@codeisgreat.org> (raw)
In-Reply-To: <87sg915cdx.fsf@gmail.com> (Partha Pratim Ghosh's message of "Sun, 22 Nov 2020 23:07:22 +0200")

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




      reply	other threads:[~2020-11-23  2:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-21 22:47 Garbled up html output Partha Pratim Ghosh
2020-11-22 11:30 ` Pankaj Jangid
2020-11-22 21:07   ` Partha Pratim Ghosh
2020-11-23  2:44     ` Pankaj Jangid [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2wnyceqrj.fsf@codeisgreat.org \
    --to=pankaj@codeisgreat.org \
    --cc=ghosh.parthapratim.unisa@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).