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);
' [38;5;240;1m .-. [0m Heavy rain, mist '
+' [38;5;240;1m ( ). [0m [38;5;118m+14[0m([38;5;118m13[0m) °C[0m '
+' [38;5;240;1m (___(__) [0m [1m?[0m [38;5;154m9[0m km/h[0m '
+' [38;5;21;1m ‚‘‚‘‚‘‚‘ [0m 4 km[0m '
+' [38;5;21;1m ‚ ’‚’‚’‚’ [0m 0.3 mm[0m ' ;
// +-------------+
Supported output formats and views
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;
You can find a fork at: https://github.com/maxkleiner/wttr.in
ReplyDeleteVery useful for a webapp or a deskapp with maXbox
ReplyDeleteThanks
nice to try and useful for my task runner with maXbox4
ReplyDelete