3 ms·
This 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 spen
by ikornaselur 6y ago
This 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 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)
- igor_chubin 6y agoJust add `F` to the options, and you don't need `| head -17` then
- martijn9612 6y agoI wasn't sure what F you were talking about, if other people are wondering, the new command would be: w () { curl -s "wttr.in/$1?M1qF" }
- ikornaselur 6y agoOh, awesome! I don't know if they added this after I created the function or if I just didn't notice it. EDIT: I just realised that "they" is actually you!
- mimimi31 6y agoYou could do something like this w () { curl -s "wttr.in/${*// /+}" } to make it work with places that have spaces in their name. E.g. w new york
- igor_chubin 6y agoJust use IFS for this w() { ( IFS=+; curl wttr.in/"$*";); }
- ikornaselur 6y agoI love when you can post something simple like a function/alias and learn so many new things. Never seen IFS before. Updated locally and works perfectly!
- augusto-moura 6y agoPretty neat, it shadows the `w` command however. Not that is that much useful in a personal computer