Open JacksonChen666 opened 2 years ago
currently, wttr.in uses user agent strings to determine the best response to return to the client.
by default,
curl
gets ANSI in response. but let's say, someone is trying to render the HTML instead of PNG because it's so low res.the only option here is to change the user agent to something else that does not contain the keyword
curl
anywhere in the string of the user agent (not even spaces aroundcurl
work)proposals (sorted from most preferred to least preferred of personal choice and misc.):
- a long argument (similar to
lang
arg)output_format
orformat
which can=
toPNG
,HTML
,ANSI
,plain
,JSON
, etc.H
argument for getting HTML (similar to usingM
for getting meter/s wind speeds)_arguments.html
(similar to png format request)all which ignore the user agent and returns HTML anyways.
currently, wttr.in uses user agent strings to determine the best response to return to the client. by default,
curl
gets ANSI in response. but let's say, someone is trying to render the HTML instead of PNG because it's so low res. the only option here is to change the user agent to something else that does not contain the keywordcurl
anywhere in the string of the user agent (not even spaces aroundcurl
work) proposals (sorted from most preferred to least preferred of personal choice and misc.):
- a long argument (similar to
lang
arg)output_format
orformat
which can=
toPNG
,HTML
,ANSI
,plain
,JSON
, etc.H
argument for getting HTML (similar to usingM
for getting meter/s wind speeds)_arguments.html
(similar to png format request)all which ignore the user agent and returns HTML anyways.
yes, what about that?
Then why not add a mode? Or use https://github.com/chubin/wttr.in/blob/5782f4f53e1c22bf7b7d6eb7a83e37f976ae62a7/share/ansi2html.sh client-side?
It is a good feature. Accepted :+1:
currently, wttr.in uses user agent strings to determine the best response to return to the client.
by default,
curl
gets ANSI in response. but let's say, someone is trying to render the HTML instead of PNG because it's so low res.the only option here is to change the user agent to something else that does not contain the keyword
curl
anywhere in the string of the user agent (not even spaces aroundcurl
work)proposals (sorted from most preferred to least preferred of personal choice and misc.):
lang
arg)output_format
orformat
which can=
toPNG
,HTML
,ANSI
,plain
,JSON
, etc.H
argument for getting HTML (similar to usingM
for getting meter/s wind speeds)_arguments.html
(similar to png format request)all which ignore the user agent and returns HTML anyways.