{"id":288,"date":"2021-02-22T21:02:00","date_gmt":"2021-02-22T21:02:00","guid":{"rendered":"http:\/\/toogreen.ca\/blog\/?p=288"},"modified":"2022-02-10T18:25:44","modified_gmt":"2022-02-10T18:25:44","slug":"wttr-in-weather-in-cli","status":"publish","type":"post","link":"https:\/\/toogreen.ca\/blog\/index.php\/2021\/02\/22\/wttr-in-weather-in-cli\/","title":{"rendered":"Weather in CLI by poking wttr.in"},"content":{"rendered":"\n<p>Just felt like sharing this very nice and simple trick that you can perform in any UNIX-type command line system. Let&#8217;s say you&#8217;re remotely connected to a headless server and you just want to quickly know what is the weather forecast for the next few days. Simply type &#8220;curl wttr.in&#8221; followed by a slash and your city&#8217;s name. So, for example, if I want to know the weather for my own city (Montreal), I just need to type this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl wttr.in\/Montreal<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>And then below is the result of what this will look like (click to enlarge):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/toogreen.ca\/blog\/wp-content\/uploads\/2021\/02\/wttr.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"709\" src=\"https:\/\/toogreen.ca\/blog\/wp-content\/uploads\/2021\/02\/wttr-1024x709.png\" alt=\"\" class=\"wp-image-289\" srcset=\"https:\/\/toogreen.ca\/blog\/wp-content\/uploads\/2021\/02\/wttr-1024x709.png 1024w, https:\/\/toogreen.ca\/blog\/wp-content\/uploads\/2021\/02\/wttr-300x208.png 300w, https:\/\/toogreen.ca\/blog\/wp-content\/uploads\/2021\/02\/wttr-768x532.png 768w, https:\/\/toogreen.ca\/blog\/wp-content\/uploads\/2021\/02\/wttr-1536x1063.png 1536w, https:\/\/toogreen.ca\/blog\/wp-content\/uploads\/2021\/02\/wttr.png 1911w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>No worries, this will not install anything on your machine at all. All it does is poking and fetching the information from the <strong><a href=\"http:\/\/wttr.in\" data-type=\"URL\" data-id=\"wttr.in\">wttr.in<\/a><\/strong> website and displays the results on the screen. Nothing to install or anything like that. <\/p>\n\n\n\n<p>Pretty cool, huh?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just felt like sharing this very nice and simple trick that you can perform in any UNIX-type command line system. Let&#8217;s say you&#8217;re remotely connected to a headless server and you just want to quickly know what is the weather forecast for the next few days. Simply type &#8220;curl wttr.in&#8221; followed by a slash and&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,51,43],"tags":[144,146,147,148,145,87],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-coding","category-education","category-hacking","tag-cli","tag-command-line","tag-linux","tag-macos","tag-tip","tag-unix"],"_links":{"self":[{"href":"https:\/\/toogreen.ca\/blog\/index.php\/wp-json\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toogreen.ca\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/toogreen.ca\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/toogreen.ca\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/toogreen.ca\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=288"}],"version-history":[{"count":8,"href":"https:\/\/toogreen.ca\/blog\/index.php\/wp-json\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":313,"href":"https:\/\/toogreen.ca\/blog\/index.php\/wp-json\/wp\/v2\/posts\/288\/revisions\/313"}],"wp:attachment":[{"href":"https:\/\/toogreen.ca\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/toogreen.ca\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/toogreen.ca\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}