From 0e5bec697595f3b1b0594d27fe78dd2e11a30f1a Mon Sep 17 00:00:00 2001 From: Daniel <89086143+BardofSprites@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:48:00 -0400 Subject: script for grabbing radar --- bin/.local/bin/scripts/perl/radar | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 bin/.local/bin/scripts/perl/radar diff --git a/bin/.local/bin/scripts/perl/radar b/bin/.local/bin/scripts/perl/radar new file mode 100755 index 0000000..df1a222 --- /dev/null +++ b/bin/.local/bin/scripts/perl/radar @@ -0,0 +1,24 @@ +#!/usr/bin/perl +use strict; +use warnings; +use LWP::Simple; + +# URL of the NOAA weather radar GIF +my $url = 'https://radar.weather.gov/ridge/standard/KLVX_loop.gif'; + +# Path to save the downloaded GIF +my $gif_path = '/tmp/latest_radaronly.gif'; + +# Download the GIF +print "Downloading weather radar GIF...\n"; +my $status = getstore($url, $gif_path); + +if (is_success($status)) { + print "Download successful. Saved to $gif_path\n"; + + # Play the GIF with MPV + my $mpv_command = "mpv --loop-file=inf --no-osc --no-input-default-bindings --autofit=120x480 $gif_path"; + system($mpv_command); +} else { + die "Failed to download GIF: $status\n"; +} -- cgit v1.2.3