Diff for /CVSROOT/cvs2rss.pl between versions 1.11 and 1.13

version 1.11, 2005/10/25 14:09:48 version 1.13, 2008/11/26 18:43:30
Line 21 Line 21
 # Edit by Guy Albertelli, -- corrected the packaging of Entities  # Edit by Guy Albertelli, -- corrected the packaging of Entities
 #                          - commits now <pre>ed  #                          - commits now <pre>ed
 #                          - removed html rants  #                          - removed html rants
 #  # Edit by Stuart Raeburn, -- eliminated earlier HTML::Entities customization.
   
 use strict;  use strict;
 use HTML::Entities();  
 use XML::RSS;  use XML::RSS;
 use POSIX;  use POSIX;
   
 # Stuff you need to setup   # Stuff you need to setup 
 my $cvslink = 'http://install.loncapa.org/cgi-bin/cvsweb.cgi/';  my $cvslink = 'http://source.loncapa.org/cgi-bin/cvsweb.cgi/';
 my $rssFeed ="/home/loninst/public_html/loncapa.rss";  my $rssFeed ="/home/rss/cvs.rss";
 my $emailDomain = "loncapa.org";  my $emailDomain = "loncapa.org";
 my $channelTitle = "Lon-CAPA RSS Feed";  my $channelTitle = "Lon-CAPA RSS Feed";
 my $channelLink = "http://install.loncapa.org/loncapa.rss";  my $channelLink = "http://source.loncapa.org/rss/cvs.rss";
 my $numEntries = 200;  my $numEntries = 30;
   
 # Set this to 1 to enable cvs rdiff  # Set this to 1 to enable cvs rdiff
 my $cvsDiff = 1;  my $cvsDiff = 1;
Line 75  my $commit_msg; Line 74  my $commit_msg;
 while (<STDIN>) {  while (<STDIN>) {
     chomp($_);      chomp($_);
     if ($_=~/^[A-Z].*:\s*$/) {      if ($_=~/^[A-Z].*:\s*$/) {
  $_ = "<br /><b>" . &HTML::Entities::encode($_,'<>&"') . "</b><br />";   $_ = "<br /><b>" .$_."</b><br />";
     } else {      } else {
  $_ = &HTML::Entities::encode($_,'<>&"');  
  $_ .= "<br />";   $_ .= "<br />";
     }      }
     $commit_msg .= $_;      $commit_msg .= $_;
Line 103  foreach my $file (@args) { Line 101  foreach my $file (@args) {
  # This will rdiff it against the previous version, and   # This will rdiff it against the previous version, and
  # include that diff in the rss feed   # include that diff in the rss feed
   
  if (($title[1] != "NONE") && ($title[0]=~/(.*).(pm|pl|conf|tab)$/)){   if (($title[1] != "NONE") 
       && ($title[0]=~/(.*)\.(pm|pl|conf|tab)$/)
       && ($title[0]!~{/localize/localize/..\.pm}) ) {
     my $tmpFile = "/tmp/diff.$$";      my $tmpFile = "/tmp/diff.$$";
     my $cmdLine = "cvs -n rdiff -u -kk -r " . $title[1] .  " -r " . $title[2] . " " . $title[0] . ">" . $tmpFile;      my $cmdLine = "cvs -n rdiff -u -kk -r " . $title[1] .  " -r " . $title[2] . " " . $title[0] . ">" . $tmpFile;
     system($cmdLine);      system($cmdLine);
Line 111  foreach my $file (@args) { Line 111  foreach my $file (@args) {
     $description .= "<br /><b>Differences:</b><br /><pre>";      $description .= "<br /><b>Differences:</b><br /><pre>";
     open CVSDIFF, "<" . $tmpFile;      open CVSDIFF, "<" . $tmpFile;
     foreach my $line (<CVSDIFF>) {      foreach my $line (<CVSDIFF>) {
  $description .= &HTML::Entities::encode($line,'<>&"');   $description .= $line;
     }      }
     $description .= "</pre>";      $description .= "</pre>";
     unlink($tmpFile);         unlink($tmpFile);   
Line 133  foreach my $file (@args) { Line 133  foreach my $file (@args) {
    );     );
 }  }
   
 foreach my $element (@{$rss->{'items'}}) {  
     $element->{'description'} =   
  &HTML::Entities::encode($element->{'description'},'<>&"');  
 }  
   
 $rss->save($rssFeed);  $rss->save($rssFeed);
   
 # Rsync this rss feed to another publically accessable machine.  # Rsync this rss feed to another publically accessable machine.

Removed from v.1.11  
changed lines
  Added in v.1.13


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