Live data from Hacker News

ASCII Art Weather

wttr.in

41–50 of 106 posts

Re: ASCII Art Weather

#41
post #39

For PowerShell: (Invoke-WebRequest wttr.in/Brussels).AllElements | ?{$_.tagname -eq "pre"} | Select-Object -ExpandProperty outerText

Or a bit shorter:

    ((iwr wttr.in/Brussels).AllElements | ? tagname -eq pre).outerText
We could also wrap it into a function:

    function Get-Weather($Location){((iwr wttr.in/$Location).AllElements | ? tagname -eq pre).outerText}

Re: ASCII Art Weather

#42
post #37

What's impressed me about this is how much faster it is than Web pages or Android apps. Really: just transmit the data necessary to convey your information. Your app is in the way. wttr.in on Android using Termux is actually pretty awesome.

> just transmit the data necessary to convey your information What is that cruft at the bottom of the page? Also, I would prefer this as a CLI application, not as a webpage. Further it should have flags that make its output more friendly to further processing (e.g. grep). Otherwise, nicely done.

try curl(1)

Re: ASCII Art Weather

#43
post #37

What's impressed me about this is how much faster it is than Web pages or Android apps. Really: just transmit the data necessary to convey your information. Your app is in the way. wttr.in on Android using Termux is actually pretty awesome.

> just transmit the data necessary to convey your information What is that cruft at the bottom of the page? Also, I would prefer this as a CLI application, not as a webpage. Further it should have flags that make its output more friendly to further processing (e.g. grep). Otherwise, nicely done.

> Also, I would prefer this as a CLI application, not as a webpage.

    curl http://wttr.in/london
Looks nice :)

Re: ASCII Art Weather

#44
post #39

For PowerShell: (Invoke-WebRequest wttr.in/Brussels).AllElements | ?{$_.tagname -eq "pre"} | Select-Object -ExpandProperty outerText

Or you could just set/unset all the right headers and get the ASCII art directly (as `curl wttr.in/{location}` does)

Although you'll need to interpret or strip the color codes.

Re: ASCII Art Weather

#46
post #37

What's impressed me about this is how much faster it is than Web pages or Android apps. Really: just transmit the data necessary to convey your information. Your app is in the way. wttr.in on Android using Termux is actually pretty awesome.

> just transmit the data necessary to convey your information What is that cruft at the bottom of the page? Also, I would prefer this as a CLI application, not as a webpage. Further it should have flags that make its output more friendly to further processing (e.g. grep). Otherwise, nicely done.

It's actually a web frontend for a CLI application:

https://github.com/schachmat/wego

Re: ASCII Art Weather

#47
post #16

I much prefer weather via finger using graph.no: https://news.ycombinator.com/item?id=11106354 https://0p.no/2014/12/13/graph_no___weather_forecast_via_fin... And the command: finger london@graph.no Which produces this: -= Meteogram for united_kingdom/england/london =- 'C Rain (mm) 17 16 ^^^ ------^^^^^^ 15 ^^^ --- ^^^ 14^^^ ^^^ 13 ^^^ 12 ^^^ 11 ========= === ^^^ 10 ============ === 9 ' | 2 mm 8 | | | | | | | | | 1 m…

For me yr.no is almost always correct at least for the next few hours. It can be off a bit if you go a day ahead but it's updated regularly so just check often to get a picture of how the weather will be. I live in Sweden but have tried it extensively in Germany too with similar results.

Re: ASCII Art Weather

#48

What's impressed me about this is how much faster it is than Web pages or Android apps. Really: just transmit the data necessary to convey your information. Your app is in the way. wttr.in on Android using Termux is actually pretty awesome.

Try looking at the source of the page. There's no way in hell anyone would call that "just" the data necessary to convey the information. The site is also unusable on mobile, because ASCII art unlike proper semantic HTML is not easily rescalable by the browser. And it's inaccessible by users relying on screen readers, ironically because of all the ASCII cruft.

On iOS the page scales as expected. The only visual glitch with columns not matching up is something I'm getting on non-zoomed desktop as well. Presumably this is from specific source text of as-of-yet unexpected lengths not being handled properly during calculation of the maximum columns.

The accessibility issue would be resolved by using workarounds typical of screen-reader solutions: ARIA markup, tricks like Bootstrap's .sr-only class, etc. At the end of the day, neither images nor ASCII art are going to be accessible, so if you implement the required accessibility functionality, theoretically there is no difference between them. I do shudder to imagine just how ugly the source would look (hide every character of the nonsensical ascii from screen reader, and replace it with proper text representation).

Re: ASCII Art Weather

#49

Earlier quoted context omitted.

Try looking at the source of the page. There's no way in hell anyone would call that "just" the data necessary to convey the information. The site is also unusable on mobile, because ASCII art unlike proper semantic HTML is not easily rescalable by the browser. And it's inaccessible by users relying on screen readers, ironically because of all the ASCII cruft.

The inaccessible comment is somewhat ironic. If the display of the ASCII craft is in a terminal at least I have some control over the font size and, in particular, the background colour.

> in particular, the background colour

I use this on my computers at work. Its wego and the ONE frustrating thing is you can't change the colors so that they work well with a light background.

Re: ASCII Art Weather

#50
Really good! Now I can see the weather on the command line in addition to a calendar and a clock.

I think It'd be better to show the weather of yesterday instead of showing the weather of the day after tomorrow so that I can compare the sensory temperature.

Post reply on HN