Weather forecast service

Weatherbox

wttr.in is a console-oriented weather forecast service that supports various information representation methods like terminal-oriented ANSI-sequences for console HTTP clients (curl, httpie, or wget), HTML for web browsers, or PNG for graphical viewers. wttr.in uses wego for visualization and various data sources for weather forecast information. You can see it running here: wttr.in.  

Usage 

You can access the service from a shell, maXbox or from a Web browser like this:

loadWebform; //

         WebBrowser1.Navigate('file://c:/maxbox/lazarus/rssweather.htm'); 
         WebBrowser1.Navigate('https://wttr.in/Bern');

Checking the weather is usually a quick thing, but there can be a bit of satisfaction, by doing it with a click of a button. This as well only requires a single dependency. Once installed just create a file to run with the script below. After that, you are ready to run or schedule each day the following. }

 //ANSI A for the terminal; 

memo2.font.size:= 12;
memo2.font.name:= 'Lucida console'; 

pngStream:= TMemoryStream.Create;
vURL:= 'https://wttr.in/Cologne?A'; 

try
   HTTPget(vURL, pngStream)
except
   showmessage('E.message')
end 

writeln(UTF8toAnsi(streamtoString3(pngStream)));
pngStream.Free; 

ComTerminal:= TCustomComTerminal.create(self);
EditComTerminal(comterminal); 

 

Const WeatherreportVT=

    '          .-.                  Heavy rain, mist '
  +'        (   ).               [0m +14(13) °C '
  +'    (___(__)            [0m ? 9 km/h  '     
  +'           ‚‘‚‘‚‘‚‘               4 km  '         
  +'         ‚  ’‚’‚’‚’               0.3 mm  ' ;      
                                                         // +-------------+ 
 

Supported output formats and views 

wttr.in currently supports five output formats: 

ANSI for the terminal; 

Plain-text for the terminal and scripts;

HTML for the browser; 

PNG for the graphical viewers; 

JSON for scripts and APIs; 

Prometheus metrics for scripts and APIs. The ANSI and HTML formats are selected based on the User-Agent string. The script you can find: http://www.softwareschule.ch/examples/weatherbox.txt

Comments

  1. You can find a fork at: https://github.com/maxkleiner/wttr.in

    ReplyDelete
  2. Very useful for a webapp or a deskapp with maXbox
    Thanks

    ReplyDelete
  3. nice to try and useful for my task runner with maXbox4

    ReplyDelete

Post a Comment

Popular posts from this blog

CNN Pipeline Train

Google Safe Browsing API

TEE Models List