Live data from Hacker News

Curl Wttr.in

github.com

41–50 of 128 posts

Re: Curl Wttr.in

#41
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…

shameless plug: https://e.xec.sh

Re: Curl Wttr.in

#43

A while back I made something along similar lines, though not quite as useful. curl https://poptart.spinda.net

That's great, content like this is why I browse hackernews.

As someone who is still relatively new to tech, how did you make this?

You even somehow turned my black terminal screen to dark blue, even after I stopped the curl process!

Re: Curl Wttr.in

#44
post #27

Earlier quoted context omitted.

Maybe it's just me, but I find PowerShell to be so verbose. Why does every parameter have to have consist of a camelcased sentence? I'm a good typist, but I don't think what you wrote is better than curl wttr.in But that might just be (my) programming.

It's case insensitive and there are short aliases for commands. I live in Linux, but used it way back when. It's an object oriented shell that is kind of awesome and intuitive. Bash is great and you can get shit done, but i don't think it's as user friendly as powershell.

Honestly PS feels like yet another cryptic language with irregular/nih naming of functions and arguments (like AHK which is great, but invented its own megacryptic irrational language instead of taking something generic, and now you have to google every damn thing). If I programmed for PS, then okay, but seriously, Invoke-Rest-?Method, -Uri/Url, .content — how much semantics do you learn until you give up? I’d better

  http.get(url="...").body
in my console rather than this Invoke-WhatEver thing, because at least it seems programming language-y and names are consistent with all other web software.

Ed: strictly speaking, URI is not even a thing that you pass to a web request. I bet that IRM couldn’t fetch urn:isbn:0451450523.

Re: Curl Wttr.in

#45
post #43

A while back I made something along similar lines, though not quite as useful. curl https://poptart.spinda.net

That's great, content like this is why I browse hackernews. As someone who is still relatively new to tech, how did you make this? You even somehow turned my black terminal screen to dark blue, even after I stopped the curl process!

Terminal colors can be controlled using ANSI color codes. Since curl just outputs everything it receives directly to the tty, if the server response contains ANSI, your terminal will render it.

Re: Curl Wttr.in

#46
post #40

This scared me the first time I tried it because the output was perfectly sized to my terminal. I couldn't fathom how it was possible for the server to know my terminal width. It turns out my terminal was set at 125 characters wide and wttr.in outputs a 125 character width display.

Curious - wouldn't it be possible to output terminal escape characters to perform some "magic" like moving at the end of the line? Or does curl protect users by not outputting them? (I think not, because fetching a binary file by mistake sometimes garbles the output)

Re: Curl Wttr.in

#48
I 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”.

Re: Curl Wttr.in

#49
Would be nice to have Sixel/iTerm output, but almost 40 years after most computers could do split text/graphics modes, nobody uses these and we're looking at ASCII graphics instead... Might want to look at using ℃ and Emoji though for people with modern terminals.

Re: Curl Wttr.in

#50
Looks like lightning breaks the formatting a little, at least for me. Otherwise, very cool. Guessing lighting is a unicode char & not being counted "correctly", which I believe is a challenging thing
Post reply on HN