Live data from Hacker News

`curl wttr.in`: Weather in your terminal

github.com

91–100 of 147 posts

Re: `curl wttr.in`: Weather in your terminal

#91

Earlier quoted context omitted.

which begs the quotation: is there such a thing as a “firewall” for terminals? my idea is to limit the terminal’s cpu usage so that any breach does not spread quickly in the system, and maybe limit the terminal’s network access, but leave the shell out of it. idk if the last part is possible.

ObLogicalFallaciesNit: It raises the question. Begging the question is to answer the question with a premise that assumes the result. It's a form of circular reasoning . https://www.thoughtco.com/what-is-begging-the-question-falla... https://www.writersdigest.com/write-better-fiction/begging-t... And to be clear, your question is a good one. It's just that it's raised and not begged . That said, I see and hear this a…

Begging the question isn't usually used like this these days, even if it did originate thus. The English language is used the way English speakers use it; yes, even that is quite circular, because there is no formal academy setting down rules that everyone agrees on. Institutions only teach stylistic choices. We use beg the question in exactly the way you say we shouldn't far more often than not to the point that its history is merely a bit of trivia, at least to most American English speakers; Oxford has yet to catch up, but I can't imagine the English situation is that much different than the American one.

https://www.grammarphobia.com/blog/2021/11/beg-the-question....

Re: `curl wttr.in`: Weather in your terminal

#92
post #88

Earlier quoted context omitted.

This is not a problem with wttr.in, this is a problem of `watch`. It is a known issue: it can't render ANSI output. You can try to run it with any command that has ANSI output, and you will see it. As a simple alternative, you write your own 'watch' like this: while true; do curl -s wttr.in; sleep 60; clear; done

When writing these things, I prefer using the “sleep” command as the while condition. This way, the loop is easier to break out of. I.e. when I press Ctrl-C, the sleep command returns a non-zero exit code, and the while loop terminates gracefully: while sleep 60; do clear; curl -s wttr.in; done Otherwise, I very often get a loop which stubbornly refuses to abort, and I have to hammer both Ctrl-C and Ctrl-\ to make it…

Thanks for your help igor_chubin and teddyh!

According to The Fine Manual: watch --color (-c for short) , should render color correctly, eg.

    watch --color ls --color  
but

    watch --color curl -s v2.wttr.in  
doesn't quite play ball.

In the end I went with something like your solution. I didn't need to put the sleep 60 as the first operation though.

    #!/bin/bash
    while true; do
      clear 
      curl -s v2.wttr.in
      sleep 100
    done
^C breaks out of this loop just fine on my system.

Re: `curl wttr.in`: Weather in your terminal

#93
post #91

Earlier quoted context omitted.

ObLogicalFallaciesNit: It raises the question. Begging the question is to answer the question with a premise that assumes the result. It's a form of circular reasoning . https://www.thoughtco.com/what-is-begging-the-question-falla... https://www.writersdigest.com/write-better-fiction/begging-t... And to be clear, your question is a good one. It's just that it's raised and not begged . That said, I see and hear this a…

Begging the question isn't usually used like this these days, even if it did originate thus. The English language is used the way English speakers use it; yes, even that is quite circular, because there is no formal academy setting down rules that everyone agrees on. Institutions only teach stylistic choices. We use beg the question in exactly the way you say we shouldn't far more often than not to the point that its…

I'm well aware.

In this case, I tend to strongly prefer the prescriptivist view to the prescriptivist, and misuse generates confusion rather than clarity.

Words ... should mean things. Particularly when they're specifically referring to illegitimate reasoning in the first place.

"Enormity", "disinterested", and "very unique" are others on my list.

Re: `curl wttr.in`: Weather in your terminal

#94
post #88

Earlier quoted context omitted.

When writing these things, I prefer using the “sleep” command as the while condition. This way, the loop is easier to break out of. I.e. when I press Ctrl-C, the sleep command returns a non-zero exit code, and the while loop terminates gracefully: while sleep 60; do clear; curl -s wttr.in; done Otherwise, I very often get a loop which stubbornly refuses to abort, and I have to hammer both Ctrl-C and Ctrl-\ to make it…

Thanks for your help igor_chubin and teddyh! According to The Fine Manual: watch --color (-c for short) , should render color correctly, eg. watch --color ls --color but watch --color curl -s v2.wttr.in doesn't quite play ball. In the end I went with something like your solution. I didn't need to put the sleep 60 as the first operation though. #!/bin/bash while true; do clear curl -s v2.wttr.in sleep 100 done ^C brea…

> ^C breaks out of this loop just fine on my system.

It might be different when run as a script (with a separate shell process) to when run as an explicit loop in an interactive shell, or a shell function.

Re: `curl wttr.in`: Weather in your terminal

#95
post #42

In the USA, I like the National Weather Service direct APIs. I wish I could get more granular forecast data, both in time and space, but they forecast dewpoint/humidity, which is really nice.

Any links on that? I wrote a set of scripts --- it takes thee , a bash function, sed, and awk --- to parse the dumped formatted HTML to a more usable form on a terminal. Raw APIs might be more convenient / less complicated.

https://www.weather.gov/documentation/services-web-api

Re: `curl wttr.in`: Weather in your terminal

#96
post #8

Earlier quoted context omitted.

I think you are comparing a weather model with the current reading from a weather station.

So you are saying that "weather right now" shouldn't be a reading from weather station?

No. It should. But a lot of weather data sites use data from models instead of current readings from nearby stations.

Re: `curl wttr.in`: Weather in your terminal

#97
post #57

Earlier quoted context omitted.

The terminal (or rather terminal emulation) is a mistake, people should stop glorifying it. It has no inherent value, beyond being able to run historical software that was bound to a terminal. Most of all one should stop confusing the terminal and the shell, which remains an interesting concept.

Then where should the shell be run?

on the DOM, of course /s

Re: `curl wttr.in`: Weather in your terminal

#98

If only there's a $PS1 version

That would be cool, but how would you condense the information enough that it's both useful and doesn't take up 2/3 of a line?

> how would you condense the information enough that it's both useful and doesn't take up 2/3 of a line?

There's a method that takes 0 space: just change the color of the prompt symbol depending on the weather status (sunny, cloudy, raining, snowing).

Re: `curl wttr.in`: Weather in your terminal

#99

Earlier quoted context omitted.

Any links on that? I wrote a set of scripts --- it takes thee , a bash function, sed, and awk --- to parse the dumped formatted HTML to a more usable form on a terminal. Raw APIs might be more convenient / less complicated.

https://www.weather.gov/documentation/services-web-api

Thanks!
Post reply on HN