X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fimportwwv.pl;h=f0fcfec0d651d093e7563e009144105bbbeee0e8;hb=f63d598af3f797b56b8d5e23ec4ff5254192eee9;hp=2a86e0dee74164210f3db4a538c1cde8ec2fda40;hpb=0e845eee9c8fcc754e9f6a238750fd93822b9506;p=spider.git diff --git a/perl/importwwv.pl b/perl/importwwv.pl index 2a86e0de..f0fcfec0 100755 --- a/perl/importwwv.pl +++ b/perl/importwwv.pl @@ -11,7 +11,7 @@ # # Copyright (c) 2004 Dirk Koopman G1TLH # -# $Id$ +# # use strict; @@ -37,7 +37,7 @@ my $msg = Mail::Internet->new(\*STDIN) or die "Mail::Internet $!"; my $head = $msg->head->header_hashref; if ($head) { - if ($head->{From}->[0] =~ /wwv/i || $head->{'From '}->[0] =~ /wwv/i) { + if ($head->{Subject}->[0] =~ /wwv/i) { process_wwv($msg); } elsif ($head->{From}->[0] =~ /rwc\.boulder/i || $head->{'From '}->[0] =~ /rwc\.boulder/i) { process_solar($msg); @@ -62,6 +62,7 @@ sub process_wwv } if ($state) { my $l = $_; + next if /\bSec\b/i; $l =~ s/\s*\.?\r?\n$//; push @out, $l; } @@ -87,6 +88,7 @@ sub process_solar } if ($state > 1) { my $l = $_; + next if /\bSec\b/i; $l =~ s/\r?\n$//; push @out, $l; } @@ -99,6 +101,7 @@ sub out my $fn = "solar.txt.$$"; open OUT, ">$tmp/$fn" or die "import $tmp/$fn $!"; + chmod 0666, "$tmp/$fn"; print OUT map { "$_\n" } @_; close OUT;