Diff for /loncom/publisher/lonpublisher.pm between versions 1.4 and 1.5

version 1.4, 2000/11/30 10:11:47 version 1.5, 2000/11/30 11:22:58
Line 16  use HTML::TokeParser; Line 16  use HTML::TokeParser;
 use Apache::lonxml;  use Apache::lonxml;
   
 my %addid;  my %addid;
   my %nokey;
   
 sub publish {  sub publish {
   
Line 144  sub publish { Line 145  sub publish {
 # -------------------------------------------------- Parse content for metadata  # -------------------------------------------------- Parse content for metadata
   
  my $allmeta=Apache::lonxml::xmlparse('meta',$content);   my $allmeta=Apache::lonxml::xmlparse('meta',$content);
           
   # DEBUG:
   
         $scrout=$allmeta;          $scrout=$allmeta;
   
   # --------------------------------------------------- Scan content for keywords
    {
       my $textonly=$content;
               $textonly=~s/\<script[^\<]+\<\/script\>//g;
               $textonly=~s/\<m\>[^\<]+\<\/m\>//g;
               $textonly=~s/\<[^\>]*\>//g;
               $textonly=~tr/A-Z/a-z/;
               $textonly=~s/[\$\&][a-z]\w*//g;
               $textonly=~s/[^a-z\s]//g;
   
               my %keywords=();
               map {
    unless ($nokey{$_}) {
                      $keywords{$_}=1;
                   } 
               } ($textonly=~m/(\w+)/g);
   
   # DEBUG:
   
          $scrout=join('<br>',sort keys %keywords);
   
           }         
           
   
     }      }
     return $scrout;      return $scrout;
 }  }
Line 213  sub handler { Line 240  sub handler {
           $addid{$1}=$2;            $addid{$1}=$2;
       }        }
   }    }
   
     %nokey=();
   
     {
        my $fh=Apache::File->new($r->dir_config('lonIncludes').'/un_keyword.tab');
         map {
             my $word=$_;
             chomp($word);
             $nokey{$word}=1;
         } <$fh>;
     }
 # ----------------------------------------------------------- Start page output  # ----------------------------------------------------------- Start page output
   
   $r->content_type('text/html');    $r->content_type('text/html');

Removed from v.1.4  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>