Live data from Hacker News

Curl Wttr.in

github.com

101–110 of 128 posts

Re: Curl Wttr.in

#101
post #35

I use this all the time. I find this option pretty neat: curl wttr.in/Moon Shows current lunar phase. I use Termux[0] on my phone with curl installed. Pretty handy. Also, check out rate.sx[1] from the same author: curl rate.sx Shows information about current exchange rates of cryptocoins. More similar console services: https://github.com/chubin/awesome-console-services [0]: https://termux.com/ [1]: https://github.com…

Thank you very much for sharing this info. Now I can use wttr.in in a varied manner

Re: Curl Wttr.in

#102
post #35

I use this all the time. I find this option pretty neat: curl wttr.in/Moon Shows current lunar phase. I use Termux[0] on my phone with curl installed. Pretty handy. Also, check out rate.sx[1] from the same author: curl rate.sx Shows information about current exchange rates of cryptocoins. More similar console services: https://github.com/chubin/awesome-console-services [0]: https://termux.com/ [1]: https://github.com…

Also very useful: curl ifconfig.co (shows your public ip)

Don’t forget the /json

Re: Curl Wttr.in

#103

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…

Pretty neat, it shadows the `w` command however. Not that is that much useful in a personal computer

Re: Curl Wttr.in

#104
post #10

A good opportunity to remind everyone that we finally inboxed curl into Windows 10, so this works (with color output) from a stock Windows command prompt. Better late than never, I hope.

No need for that. You can do this: (Invoke-WebRequest -Uri wttr.in).content from Powershell. Why not use the happy path?

This works great from the new Windows Terminal (using PowerShell 7):

  Invoke-RestMethod http://wttr.in
For some reason they recommend that early in the readme, but not down in https://github.com/chubin/wttr.in#windows-users where they discuss various issues on Windows.

EDIT: I see now that lzybkr already suggested using the even shorter alias `irm` for `Invoke-RestMethod`. Nice!

Re: Curl Wttr.in

#105
One of the downsides is that if you have curl set to not use a user agent, it (along with many such services) won't work.

So

  curl --user-agent "" wttr.in
just serves you unformatted HTML.

Re: Curl Wttr.in

#106
post #10

A good opportunity to remind everyone that we finally inboxed curl into Windows 10, so this works (with color output) from a stock Windows command prompt. Better late than never, I hope.

No need for that. You can do this: (Invoke-WebRequest -Uri wttr.in).content from Powershell. Why not use the happy path?

This handy function will ask and remember the city:

https://github.com/majkinetor/posh/blob/master/MM_Sugar/Get-...

Re: Curl Wttr.in

#107
post #105

One of the downsides is that if you have curl set to not use a user agent, it (along with many such services) won't work. So curl --user-agent "" wttr.in just serves you unformatted HTML.

Just use

    curl --user-agant "" wttr.in?A
for that.

The `A` option enforces ANSI output (curl wttr.in/:help for more)

Re: Curl Wttr.in

#108
post #84
post #32

Earlier quoted context omitted.

My team shipped the next generation (after ANSI.SYS) of VT support with the first release of Windows 10 back in 2015. We keep adding things to it, trying to make sure we stay compatible with Xterm. It really is a different landscape now :) The console subsystem is open-source at https://github.com/microsoft/terminal . Feel free to file bugs, complain, or what have you. That’s what we’re here for! To quote GP, “better…

Is there anyway to get the new terminal working on Windows 10 LTSC? It seems as though a newer version of Windows is required. A backport maybe?

Unfortunately, we’ve got a couple dependencies on platform features that first shipped in 1903. Whether we can divest ourselves of those dependencies has been the topic of significant discussion recently! No promises, but we’ll do what we can.

Re: Curl Wttr.in

#109
post #105

One of the downsides is that if you have curl set to not use a user agent, it (along with many such services) won't work. So curl --user-agent "" wttr.in just serves you unformatted HTML.

Just use curl --user-agant "" wttr.in?A for that. The `A` option enforces ANSI output (curl wttr.in/:help for more)

Oh nice, thanks! I wish more services would do that.

(btw there's a typo, should be --user-agent)

Re: Curl Wttr.in

#110

Earlier quoted context omitted.

Serious question -- not a flame war :) I honestly can't tell if this is sarcastic or not. I've been typing `curl -O http: ...` into command prompts for decades, and that Powershell incantation looks awfully unwieldy. In what way is it the happy path?

Because it's the native Windows answer. There's no need to make Windows look like Unix. It's great (really!) the way it was designed.

Do you feel like you are typing a lot more for simple things like this?
Post reply on HN