From b3a1df8efe4598bf95a7fc4d75b9df8c01497357 Mon Sep 17 00:00:00 2001 From: KeeganForelight Date: Fri, 13 Jan 2023 16:26:09 -0500 Subject: [PATCH] added response --- server_weather.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server_weather.sh b/server_weather.sh index a53f4f0..2998292 100755 --- a/server_weather.sh +++ b/server_weather.sh @@ -9,13 +9,15 @@ source "$WORKING_DIR/.env.key" lookup_location() { # search for a location url="http://api.openweathermap.org/geo/1.0/direct?q=$SEARCH&appid=$API_KEY" - curl --silent -fL "$url" + res=$(curl --silent -fL "$url") + echo "$res" } lookup_zipcode() { # lookup based on zipcode url="http://api.openweathermap.org/geo/1.0/zip?zip=$ZIPCODE&appid=$API_KEY" - curl --silent -fL "$url" + res=$(curl --silent -fL "$url") + echo "$res" } get_weather() { @@ -24,7 +26,8 @@ get_weather() { LON=$(echo "$COORDS" | awk -F , '{print $2}') url="https://api.openweathermap.org/data/2.5/weather\?lat=$LAT\&lon=$LON\&appid=$API_KEY\&units=imperial" - curl --silent -fL "$url" + res=$(curl --silent -fL "$url") + echo "$res" } while getopts "c:s:z:" arg; do