in reply to get() from website hangs

The weather.gov website has an API where you should be able to get all that information without scraping HTML. Also see https://forecast-v3.weather.gov/documentation. I use this in Weather::WeatherGov (unreleased) to fetch weather data as JSON for a given latitude/longitude

use strict; use HTTP::Tiny; use URI; use JSON 'decode_json'; use Moo 2; use feature 'signatures'; no warnings 'experimental::signatures'; our $base_uri = URI->new( $ENV{PERL_WEATHER_WEATHERGOV_URI} #|| 'https://forecast-v3.weather.gov/' || 'https://api.weather.gov/points/' ); my $ua = HTTP::Tiny->new( agent => "Weather::WeatherGov/$VERSION", ); sub forecast( %options ) { my $entry = base_uri . sprintf '%s,%s', $options{latitude}, $options{longitude}; # We should cache this request for office and grid position # maybe store these in the same SQLite database(schema) as Weather +::MOSMIX?! # also, we need a cache and rate-limiter here so we can rate-limit # at least by IP address and maybe also globally how much we hit w +eather.gov my $loc = $self->json_request($entry); json_request( $loc->{properties}->{forecastHourly}, ); } sub json_request( $uri ) { my $response = $ua->request(GET => $uri, { accept => 'JSON-LD', } ); decode_json( $response->{content} ); }