about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-06-16 02:26:59 +0530
committerAndinus <andinus@nand.sh>2020-06-16 02:26:59 +0530
commit4254fe9296d86dafd5d93b959bc2ff1c612a23e6 (patch)
tree4981982f5c83670b9166099b445844696dd01304
parent56fb679669d6320c4dd0a43352a10fd9a150a315 (diff)
downloadara-4254fe9296d86dafd5d93b959bc2ff1c612a23e6.tar.gz
Remove HTTP::Tiny related code, change $response to $status
-rwxr-xr-xara.pl9
1 files changed, 3 insertions, 6 deletions
diff --git a/ara.pl b/ara.pl
index c6c898b..401777b 100755
--- a/ara.pl
+++ b/ara.pl
@@ -146,13 +146,10 @@ if ( not $use_local_file
     # Fetch latest data from api.
     my $url = 'https://api.covid19india.org/data.json';
 
-    my $response = HTTP::Simple::getstore($url, $file);
+    my $status = HTTP::Simple::getstore($url, $file);
 
-    die "Failed to fetch latest data...
-Reason: $response->{reason}\n
-Content: $response->{content}
-Status: $response->{status}\n"
-        unless HTTP::Simple::is_success($response);
+    die "Failed to fetch latest data\n"
+        unless HTTP::Simple::is_success($status);
 }
 
 # Slurp api response to $file_data.