From 376031ee0e8863a2df5869d955fa824f69e6ed18 Mon Sep 17 00:00:00 2001 From: bluesaxman Date: Tue, 21 Jan 2020 15:10:25 -0700 Subject: [PATCH] added silent and timeout flags to curl --- weatherbug.sh | 2 +- weathergov.sh | 2 +- wttrin.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/weatherbug.sh b/weatherbug.sh index 846e596..916b316 100755 --- a/weatherbug.sh +++ b/weatherbug.sh @@ -9,7 +9,7 @@ my $URL_lng = -111.93882; my $URL_ProID = 23; my $URL_StatID = "C3430"; -my $info = `curl https://www.weatherbug.com/api/observation?lat=$URL_lat&lng=$URL_lng&providerId=$URL_ProID&stationId=$URL_StatID` or die "Error"; +my $info = `curl -sm 5 https://www.weatherbug.com/api/observation?lat=$URL_lat&lng=$URL_lng&providerId=$URL_ProID&stationId=$URL_StatID` or die "Error"; my $json = decode_json $info or die "Error"; diff --git a/weathergov.sh b/weathergov.sh index e046969..fec583b 100755 --- a/weathergov.sh +++ b/weathergov.sh @@ -6,7 +6,7 @@ use JSON; my $URL_lat = 40.4936; my $URL_lon = -111.9388; -my $info = `curl "https://forecast.weather.gov/MapClick.php?lat=$URL_lat&lon=$URL_lon&unit=0&lg=english&FcstType=json"` or die "Error"; +my $info = `curl -sm 5 "https://forecast.weather.gov/MapClick.php?lat=$URL_lat&lon=$URL_lon&unit=0&lg=english&FcstType=json"` or die "Error"; my $json = decode_json $info or die "Error"; diff --git a/wttrin.sh b/wttrin.sh index fe8a1ab..6bfbb23 100755 --- a/wttrin.sh +++ b/wttrin.sh @@ -3,7 +3,7 @@ use strict; use warnings; use JSON; -my $info = `curl wttr.in/bluffdale?format=j1` or die "Error"; +my $info = `curl -sm 5 wttr.in/bluffdale?format=j1` or die "Error"; my $json = decode_json $info or die "Error";