diff options
| author | Daniel <[email protected]> | 2024-07-16 15:48:00 -0400 |
|---|---|---|
| committer | Daniel <[email protected]> | 2024-07-16 15:48:00 -0400 |
| commit | 0e5bec697595f3b1b0594d27fe78dd2e11a30f1a (patch) | |
| tree | 085677bb6d2b477aec6fbb496b77a1d9fe459160 | |
| parent | 0fd36e4dc55bb40579fb4cce1ca1bd577e26d84f (diff) | |
script for grabbing radar
| -rwxr-xr-x | bin/.local/bin/scripts/perl/radar | 24 |
1 files changed, 24 insertions, 0 deletions
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"; +} |
