[LON-CAPA-cvs] cvs: CVSROOT / cvs2rss.pl

raeburn raeburn@source.lon-capa.org
Wed, 26 Nov 2008 18:43:30 -0000


raeburn		Wed Nov 26 18:43:30 2008 EDT

  Modified files:              
    /CVSROOT	cvs2rss.pl 
  Log:
  - Eliminate custom use of HTML::Entities() - XML::RSS 1.36 now used on CVS server does this automatically.
  - location of RSS feed changed (new CVS server).
  - style.
  
  
Index: CVSROOT/cvs2rss.pl
diff -u CVSROOT/cvs2rss.pl:1.12 CVSROOT/cvs2rss.pl:1.13
--- CVSROOT/cvs2rss.pl:1.12	Tue Jan 23 21:30:08 2007
+++ CVSROOT/cvs2rss.pl	Wed Nov 26 18:43:30 2008
@@ -21,19 +21,18 @@
 # Edit by Guy Albertelli, -- corrected the packaging of Entities
 #                          - commits now <pre>ed
 #                          - removed html rants
-#
+# Edit by Stuart Raeburn, -- eliminated earlier HTML::Entities customization.
 
 use strict;
-use HTML::Entities();
 use XML::RSS;
 use POSIX;
 
 # Stuff you need to setup 
-my $cvslink = 'http://install.loncapa.org/cgi-bin/cvsweb.cgi/';
-my $rssFeed ="/home/loninst/public_html/loncapa.rss";
+my $cvslink = 'http://source.loncapa.org/cgi-bin/cvsweb.cgi/';
+my $rssFeed ="/home/rss/cvs.rss";
 my $emailDomain = "loncapa.org";
 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 = 30;
 
 # Set this to 1 to enable cvs rdiff
@@ -75,9 +74,8 @@
 while (<STDIN>) {
     chomp($_);
     if ($_=~/^[A-Z].*:\s*$/) {
-	$_ = "<br /><b>" . &HTML::Entities::encode($_,'<>&"') . "</b><br />";
+	$_ = "<br /><b>" .$_."</b><br />";
     } else {
-	$_ = &HTML::Entities::encode($_,'<>&"');
 	$_ .= "<br />";
     }
     $commit_msg .= $_;
@@ -105,7 +103,7 @@
 
 	if (($title[1] != "NONE") 
 	    && ($title[0]=~/(.*)\.(pm|pl|conf|tab)$/)
-	    && ($title[0]!~|/localize/localize/..\.pm|) ) {
+	    && ($title[0]!~{/localize/localize/..\.pm}) ) {
 	    my $tmpFile = "/tmp/diff.$$";
 	    my $cmdLine = "cvs -n rdiff -u -kk -r " . $title[1] .  " -r " . $title[2] . " " . $title[0] . ">" . $tmpFile;
 	    system($cmdLine);
@@ -113,7 +111,7 @@
 	    $description .= "<br /><b>Differences:</b><br /><pre>";
 	    open CVSDIFF, "<" . $tmpFile;
 	    foreach my $line (<CVSDIFF>) {
-		$description .= &HTML::Entities::encode($line,'<>&"');
+		$description .= $line;
 	    }
 	    $description .= "</pre>";
 	    unlink($tmpFile);   
@@ -135,11 +133,6 @@
 		   );		
 }
 
-foreach my $element (@{$rss->{'items'}}) {
-    $element->{'description'} = 
-	&HTML::Entities::encode($element->{'description'},'<>&"');
-}
-
 $rss->save($rssFeed);
 
 # Rsync this rss feed to another publically accessable machine.