changeset 185:64e06ee172c7

Add HTTP user agent setting.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 03 Jun 2014 21:38:40 +0300
parents a496dc87a7c1
children b41c525bdaf7
files fetch_weather.pl
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/fetch_weather.pl	Tue Jun 03 21:38:24 2014 +0300
+++ b/fetch_weather.pl	Tue Jun 03 21:38:40 2014 +0300
@@ -30,6 +30,7 @@
   "opt_tiehallinto" => 0,
   "fmi_api_key" => "",
   "outfile" => "",
+  "http_user_agent" => "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 6.0) Opera 10.63  [en]",
 );
 
 
@@ -45,7 +46,7 @@
 sub fetch_http($)
 {
   my $tmpAgent = LWP::UserAgent->new;
-  $tmpAgent->agent("Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 6.0) Opera 10.63  [en]");
+  $tmpAgent->agent($settings{"http_user_agent"});
   $tmpAgent->timeout(10);
 
   my $tmpRequest = HTTP::Request->new(GET => $_[0]);