changeset 461:721a56cd62e3

fetch_weather: Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 18 Dec 2017 14:41:51 +0200
parents dbe249968591
children 9b4b1e4ce313
files fetch_weather.pl
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/fetch_weather.pl	Mon Oct 30 15:46:50 2017 +0200
+++ b/fetch_weather.pl	Mon Dec 18 14:41:51 2017 +0200
@@ -62,7 +62,7 @@
 sub fetch_http($)
 {
   my $agent = LWP::UserAgent->new;
-  $agent->agent($settings{"http_user_agent"});
+  $agent->agent(opt_get("http_user_agent"));
   $agent->timeout(20);
 
   my $req = HTTP::Request->new(GET => $_[0]);
@@ -251,7 +251,8 @@
     {
       my $key = lc($1);
       my $value = $2;
-      if (defined($settings{$key})) {
+      if (defined($settings{$key}))
+      {
         $settings{$key} = $value;
       }
       else
@@ -322,7 +323,7 @@
 }
 
 opt_read_config($opt_cfgfile) == 0 or die("Errors while parsing configuration file '".$opt_cfgfile."'.\n");
-print STDERR "Forcing update of all data.\n" if $settings{"force_update"};
+print STDERR "Forcing update of all data.\n" if opt_chk_bool("force_update");
 
 
 ###