TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Weather reports with curl

89 pointsby theptrkalmost 7 years ago

20 comments

ternaryoperatoralmost 7 years ago
&gt; curl is a program that is included in your Mac OSX distribution used for transferring data from or to a server.<p>For newbies who might be misled, cURL is available on a ridiculous number of platforms[1]<p>[1] <a href="https:&#x2F;&#x2F;curl.haxx.se&#x2F;download.html" rel="nofollow">https:&#x2F;&#x2F;curl.haxx.se&#x2F;download.html</a>
评论 #17488435 未加载
gkyaalmost 7 years ago
Nice! The <a href="http:&#x2F;&#x2F;wttr.in" rel="nofollow">http:&#x2F;&#x2F;wttr.in</a> website shows a nice report too.<p>If you use emacs, I&#x27;ve made this [1][2] which gets its data from DarkSky.net.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;cadadr&#x2F;elisp&#x2F;blob&#x2F;master&#x2F;forecast.el" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cadadr&#x2F;elisp&#x2F;blob&#x2F;master&#x2F;forecast.el</a><p>[2] <a href="https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;cadadr&#x2F;elisp&#x2F;master&#x2F;forecast.el.png" rel="nofollow">https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;cadadr&#x2F;elisp&#x2F;master&#x2F;foreca...</a>
评论 #17488450 未加载
samchengalmost 7 years ago
My favorite text-based weather report is definitely the &quot;discussion&quot; product from the National Weather Service. It gives some perspective, instead of just the numbers. Importantly, it commonly has a discussion of forecast confidence&#x2F;uncertainty.<p>If you read it long enough, you&#x27;ll start to pick up some of the &#x27;why&#x27; in the weather.<p>Here&#x27;s an example:<p><a href="https:&#x2F;&#x2F;forecast.weather.gov&#x2F;product.php?site=NWS&amp;issuedby=MTR&amp;product=AFD&amp;format=CI&amp;version=1&amp;glossary=1" rel="nofollow">https:&#x2F;&#x2F;forecast.weather.gov&#x2F;product.php?site=NWS&amp;issuedby=M...</a><p>I suppose you could curl it...
评论 #17488103 未加载
moreentropyalmost 7 years ago
Video of wttr.in author&#x27;s short talk about console oriented services at CCC&#x2F;entropia&#x27;s GPN18 conference two months ago:<p><a href="https:&#x2F;&#x2F;media.ccc.de&#x2F;v&#x2F;gpn18-164-using-and-creating-console-oriented-services-such-as-wttr-in-cheat-sh-rate-sx-etc-" rel="nofollow">https:&#x2F;&#x2F;media.ccc.de&#x2F;v&#x2F;gpn18-164-using-and-creating-console-...</a>
评论 #17489985 未加载
yakshaving_jgtalmost 7 years ago
Nice. You can also get a little weather indicator based on your IP address in your tmux status bar. Sorry to push my own stuff, but many people have enjoyed this:<p><a href="https:&#x2F;&#x2F;jezenthomas.com&#x2F;showing-the-weather-in-tmux&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jezenthomas.com&#x2F;showing-the-weather-in-tmux&#x2F;</a>
andreineculaualmost 7 years ago
Alternative: finger and the Norwegian weather service YR - <a href="https:&#x2F;&#x2F;github.com&#x2F;ways&#x2F;pyyrascii" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ways&#x2F;pyyrascii</a>
评论 #17488316 未加载
bionoidalmost 7 years ago
If you are delivering software or hardware products that include weather forecast, do not rely on anyone else&#x27;s API directly. Build a wrapper service and direct your clients there.<p>As a particularly disasterous example, the Yahoo Weather API was unchanged for the longest time. Integrators worldwide deployed thousands - no probably millions - of systems using an unofficial &quot;Yahoo Weather Module&quot;. It was the canonical solution.<p>Then they made a breaking change to the API and everyone cried.
craftyguyalmost 7 years ago
On zsh, I had to surround the url in quotes since it (zsh) kept trying to handle the &#x27;?&#x27;
Fnoordalmost 7 years ago
I like it (the usage of ascii chars to draw the weather, the usage of arrow for wind direction, the articulation on temperate with color)<p>The geolocation is off (as usual) because it uses the same DB as ipleak.net and others which is wrong for my (semi static) cable IPv4. I don&#x27;t mind though, I just add some city.<p>It doesn&#x27;t show well in a standard 80x25 terminal either, and that I do mind. That&#x27;s my main issue with it.<p>So I ended up with:<p>n=0 ; while (( $n &lt;= 72 )) ; date ; do curl wttr.in&#x2F;~Amsterdam?0 ; sleep 1200 ; n=$(( n+1 )) ; done<p>Which grabs the weather every 20 min for 24 hours straight after which it has to be restarted. Not sure how it deals with laptop&#x27;s suspend though.<p>watch -cn 1200 didn&#x27;t work for me because while it does parse the ascii colors, it doesn&#x27;t show them.<p>Since that hammers the servers though I&#x27;d write an alias for wttr.in&#x2F;~Amsterdam?0 such as &#x27;gcw&#x27; (&quot;get current weather&quot;) or something like that.<p>Anyway, instead of having a dedicated terminal for this open (e.g. in Tmux) its probably better to queue for this every X minutes in Tmux statusbar as someone else suggested.<p>For now though I just use the KNMI application on Android though which gives a notification in the morning and evening about the weather (the evening one also describing the forecast for next day). Its basically as if watching the weather forecast on TV. I get the notification on my smartwatch as well (Pebble 2).<p>Also, this doesn&#x27;t beat Android&#x27;s Buienalarm push notification service which alerts you right before it is going to rain on current location plus locations you specified (home, work, family, etc)
评论 #17489167 未加载
dansoalmost 7 years ago
Given that `curl` was initially created to make it easier to fetch currency rates for IRC, seems very apt for users to learn to use it for everyday things like checking the weather<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;Lq2ksox21Eg?t=6m11s" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;Lq2ksox21Eg?t=6m11s</a>
emwjacobsonalmost 7 years ago
Calling it on its own always returns the weather for Ottawa. Id expect it to use the requesting IP&#x27;s location at the least. Using wttr.in&#x2F;~LosAngeles returns the weather for &quot;Rua Professora Maria Losângeles Navarro&quot;, a street in Brazil.
评论 #17488534 未加载
评论 #17488988 未加载
评论 #17487313 未加载
评论 #17488442 未加载
评论 #17487229 未加载
评论 #17487262 未加载
hyperpalliumalmost 7 years ago
Very nice. But can&#x27;t you adjust column width for mobile terminals.<p>docs: <a href="https:&#x2F;&#x2F;github.com&#x2F;chubin&#x2F;wttr.in&#x2F;blob&#x2F;master&#x2F;README.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;chubin&#x2F;wttr.in&#x2F;blob&#x2F;master&#x2F;README.md</a>
mongolalmost 7 years ago
Nice. But wind speed when expressed in SI units are more often expressed as m&#x2F;s rather than km&#x2F;h.
评论 #17488772 未加载
Bromsklossalmost 7 years ago
&gt; Notice that wttr is returning ASCII characters.<p>The wind arrows are not ASCII. Not that I have any trouble with that.
评论 #17494753 未加载
theptrkalmost 7 years ago
oh no I think we maxed out the API calls. &quot;Sorry, we are running out of queries to the weather service at the moment. Here is the weather report for the default city (just to show you, how it looks like). We will get new queries as soon as possible.&quot;
swanlykalmost 7 years ago
Can anyone suggest any other good curl-able datasets for other domain areas?
评论 #17494763 未加载
charleymaalmost 7 years ago
Love simple services that do exactly what you would expect
评论 #17488703 未加载
Jaruzelalmost 7 years ago
I have curl installed on Windows 10... this is what I got:<p><a href="https:&#x2F;&#x2F;imgur.com&#x2F;xOAUhOU" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;xOAUhOU</a><p>Well done Windows, well done. ;)<p><i>(Yes, I know why it looks crap)</i>
fergiealmost 7 years ago
Wow- the thunder animation is pretty cool
评论 #17489904 未加载
rmbeardalmost 7 years ago
Worked beautifully for me. Love it.