wttr.in icon indicating copy to clipboard operation
wttr.in copied to clipboard

explicit request for HTML

Open JacksonChen666 opened this issue 3 years ago • 5 comments

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 around curl work)

proposals (sorted from most preferred to least preferred of personal choice and misc.):

  • a long argument (similar to lang arg) output_format or format which can = to PNG, HTML, ANSI, plain, JSON, etc.
  • H argument for getting HTML (similar to using M for getting meter/s wind speeds)
  • _arguments.html (similar to png format request)

all which ignore the user agent and returns HTML anyways.

JacksonChen666 avatar Feb 19 '22 22:02 JacksonChen666

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 around curl work)

proposals (sorted from most preferred to least preferred of personal choice and misc.):

  • a long argument (similar to lang arg) output_format or format which can = to PNG, HTML, ANSI, plain, JSON, etc.
  • H argument for getting HTML (similar to using M for getting meter/s wind speeds)
  • _arguments.html (similar to png format request)

all which ignore the user agent and returns HTML anyways.

https://wttr.in/:help

hello-smile6 avatar Feb 19 '22 23:02 hello-smile6

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 around curl work) proposals (sorted from most preferred to least preferred of personal choice and misc.):

  • a long argument (similar to lang arg) output_format or format which can = to PNG, HTML, ANSI, plain, JSON, etc.
  • H argument for getting HTML (similar to using M for getting meter/s wind speeds)
  • _arguments.html (similar to png format request)

all which ignore the user agent and returns HTML anyways.

https://wttr.in/:help

yes, what about that?

Screen Shot 2022-02-20 at 19 50 12

JacksonChen666 avatar Feb 20 '22 18:02 JacksonChen666

Then why not add a mode? Or use https://github.com/chubin/wttr.in/blob/5782f4f53e1c22bf7b7d6eb7a83e37f976ae62a7/share/ansi2html.sh client-side?

hello-smile6 avatar Feb 20 '22 19:02 hello-smile6

Also, https://github.com/chubin/wttr.in/blob/5782f4f53e1c22bf7b7d6eb7a83e37f976ae62a7/share/help.txt

hello-smile6 avatar Feb 20 '22 19:02 hello-smile6

It is a good feature. Accepted :+1:

chubin avatar Mar 26 '22 18:03 chubin