Changeset 1658
- Timestamp:
- 2000-11-08T11:49:49+13:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/EMAILPlug.pm
r1424 r1658 46 46 # $DateText Date: header 47 47 # $Date Date: header in GSDL format (eg: 19990924) 48 #49 # Version history50 #51 # 1.2 (2000 Jun 12) Major rewrite.52 # (The new version of Greenstone breaks some of the metadata.)53 # 1.1.1 Compensated for two-digit years like "95"54 # 1.1 (1999 Sep 20) Introduced the various metadata fileds55 # 1.0 Based on the original HTMLPlug code56 #57 58 48 59 49 package EMAILPlug; … … 112 102 # Extract basic metadata from header 113 103 my @headers = ("From", "To", "Subject", "Date"); 114 my $value = "";115 104 my %raw; 116 117 105 foreach my $name (@headers) { 118 $value = $Headers; 119 $value =~ s/.*$name://s; 120 $value =~ s/\S*:.*//s; 121 $value =~ s/\s*$//; 122 $value =~ s/\s+/ /g; 106 $raw{$name} = "No $name value"; 107 } 108 109 # Examine each line of the headers 110 my ($line, $name, $value); 111 my @parts; 112 foreach $line (split(/\n/, $Headers)) { 113 114 # Ignore lines with no content or which begin with whitespace 115 next unless ($line =~ /:/); 116 next if ($line =~ /^\s/); 117 118 # Find out what metadata is on this line 119 @parts = split(/:/, $line); 120 $name = shift @parts; 121 next unless $name; 122 next unless ($raw{$name}); 123 124 # Find the value of that metadata 125 $value = join(":", @parts); 126 $value =~ s/^\s+//; 127 $value =~ s/\s+$//; 128 129 # Store the metadata 123 130 $raw{$name} = $value; 124 131 } 125 132 126 133 # Process Date information 127 if ($raw{"Date"} ) {134 if ($raw{"Date"} !~ /No Date/) { 128 135 $raw{"DateText"} = $raw{"Date"}; 129 136
Note:
See TracChangeset
for help on using the changeset viewer.