`curl wttr.in`: Weather in your terminal
81–90 of 147 posts
Re: `curl wttr.in`: Weather in your terminal
#82Earlier quoted context omitted.
It's just cool but practically I never check weather until I'm about to leave home and then I'll just check a local weather app on my phone which should give more accurate and detailed info than a service that covers the entire world with presumably varying degree of accuracy.
but imagine if you're in a bunker hacking on your fav project, no artificial light and you wonder.. shall i go to the surface? you curl this website and, if tolerable weather conditions, you plan your ascent.
I live in a big city, it could be raining frogs in one part and a happy sunny day in the other and the best thing any weather report could say to me is 'expect rain'. And if I need to go it doesn't even matter what the report says or if I have/have not an umbrella with me.
Honestly for the last decade even if I look at the weather report I look not for the current conditions (I have eyes and windows) but what would be in a couple of hours, because temperature difference between 9PM and 3AM could be pretty significant.. and it doesn't even matter in winter and summer. *shrug_emoji*
Re: `curl wttr.in`: Weather in your terminal
#83If only there's a $PS1 version
It might just be me, but I never saw the usefulness in widgets that shows the current weather, at your current location. I mean can’t you just look out the window? Stuffing a three days weather report into $PS1 might be to much information for a prompt.
Re: `curl wttr.in`: Weather in your terminal
#84Earlier quoted context omitted.
If you have a vulnerable terminal emulator, yes. Well, the same holds for every web site you visit if you have a vulnerable browser.
Unless there were an escape sequence meaning "execute this". I am not aware such beast would exist.
Archived version of the linked commit: https://archive.softwareheritage.org/browse/revision/b80bedc... (which removes the feature entirely)
Re: `curl wttr.in`: Weather in your terminal
#85Earlier 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.
Run it in a container?
Re: `curl wttr.in`: Weather in your terminal
#86If only there's a $PS1 version
It might just be me, but I never saw the usefulness in widgets that shows the current weather, at your current location. I mean can’t you just look out the window? Stuffing a three days weather report into $PS1 might be to much information for a prompt.
Re: `curl wttr.in`: Weather in your terminal
#87Earlier quoted context omitted.
This is true of anything that ever renders to your terminal. I'm not sure this class of issue is worth worrying about, generally. Sure, these are neat and scary examples. Have you seen some of the recent GPU driver ACEs? Better not render any graphics! A generalization of this is "receiving information from third parties can lead to security issues" which is of course true. Untrusted inputs are always untrusted. Pipi…
> Better not render any graphics! Unironically a good idea. Graphics have always been a mistake - most engineers would agree that if we stuck with very basic output, our software would be in a much better place than today (and more usable, too!)
Re: `curl wttr.in`: Weather in your terminal
#88so the obvious (for me) thing to try was: watch -n 600 -c 'curl -s v2.wttr.in/' This ALMOST works, but somehow it messes up the formatting for me. For some reason watch doesn't pass through formatting cleanly or so?
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
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 stop. The downside is, of course, that I have to wait 60 seconds (in this case) the first time. When this is a problem, I just unroll the loop slightly and add an extra invocation to the beginning: clear; curl -s wttr.in; while sleep 60; do clear; curl -s wttr.in; done
This could be generalized into a terminal watch function: termwatch(){ delay="$1"; shift; clear; "$@"; while sleep "$delay"; do clear; "$@"; done; }
termwatch 60 curl -s wttr.inRe: `curl wttr.in`: Weather in your terminal
#89Earlier quoted context omitted.
I'm speechless. I never expected running curl could lead to such a security disaster.
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.
Re: `curl wttr.in`: Weather in your terminal
#90This is really neat... vim ~/.bashrc ``` alias weather='/usr/bin/curl wttr.in' ``` :wq and now: weather
Heh, I did the exact same thing. I actually did alias weather="curl wttr.in && curl v2.wttr.in && curl v3.wttr.in" so that it shows me the temperature chart and map as well. Well, v3's map isn't working so I commented that out for now but they say it should work in the future.
curl wttr.in/:help
Tou get a help document, which also shows you a way to get a suggested bash function; to wit:
curl wttr.in/:bash.function