#!/usr/bin/perl -w

#_______________________________________________________________________________

#system('cls');

++$|;

use vars qw/ $NLT $NL /; $NLT = qr/(?:\r|\n|\t)/; $NL = qr/(?:\r|\n)/;

$printerrordebug  = '';
$debug_info       = '';
$debug_info_error = '';

open( STDERR, ">&STDOUT" );

#_______________________________________________________________________________

$printdebug      = '1';
$printerrordebug = '1';
$html_page       = 'index.htm';

#_______________________________________________________________________________

use XML::RSS;
if ( $printdebug == 1 ) { print "Content-type: text/html\n\n"; }

&news_feeds_to_get;
&save_feeds_html_page;

print '<html>' . "\n" . '<head>' . "\n"
  . '<META HTTP-EQUIV="refresh" CONTENT="5;URL=../news;">' . "\n"
  . '</head>' . "\n"
  . '<body>' . "\n";
if ( $printdebug == 1 ) {
   print "<PRE>Debug Error\n-----------\n$debug_info_error</PRE>\n\n";
}
if ( $printerrordebug == 1 ) {
   print "<PRE>Debug Info\n----------\n$debug_info</PRE>\n\n";
}
print '</body>' . "\n" . '</html>' . "\n\n";

#_______________________________________________________________________________

sub news_feeds_to_get {

   #http://www.net-security.org/
   $url = 'http://www.net-security.org/dl/bck/news10.txt';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_netsec;
   $netsecuritynews = $all_news_line;
   $url             = 'http://www.net-security.org/dl/bck/vuln5.txt';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_netsec;
   $netsecurityvaul = $all_news_line;
   $url             = 'http://www.net-security.org/dl/bck/advi5.txt';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_netsec;
   $netsecurityadvi = $all_news_line;

   #http://www.cert.org/
   $url = 'http://www.cert.org/channels/certcc.rdf';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_rss;
   $certnews = $all_news_line;

   #http://www.eff.org/ Media Releases
   $url = 'http://www.eff.org/rss/press.xml';
   &get_feed;
   $no_news_items = '5';
   &sort_feed_rss;
   $effmediareleasesnews = $all_news_line;

   #http://www.eff.org/ Action Alerts
   $url = 'http://www.eff.org/rss/action.xml';
   &get_feed;
   $no_news_items = '5';
   &sort_feed_rss;
   $effactionalertsnews = $all_news_line;

   #http://www.hackinthebox.org/
   $url = 'http://www.hackinthebox.org/backend.php';
   &get_feed;
   $no_news_items = '20';
   &sort_feed_rss;
   $hackintheboxnews = $all_news_line;

   #http://www.securitynewsportal.com
   #$url='http://www.newsisfree.com/HPE/xml/feeds/30/4430.xml';
   #&get_feed; $no_news_items='5'; &sort_feed_rss;
   #$secnewsportalnews=$all_news_line;
   $url = 'http://www.prognosisx.com/infosyssec/securitynewsportal.xml';
   &get_feed;
   $no_news_items = '10';
   &sort_feed_rss;
   $secnewsportalnews = $all_news_line;

   #http://www.theregister.co.uk/
   $url = 'http://www.theregister.co.uk/tonys/slashdot.rdf';
   &get_feed;
   $content =~ s/&/&amp;/igo;
   $no_news_items = '30';
   &sort_feed_rss;
   $theregisternews = $all_news_line;

   #http://www.newsforge.com/
   $url = 'http://www.newsforge.com/newsforge.rdf';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_rss;
   $newsforgenews = $all_news_line;

   #http://www.slashdot.org/
   $url = 'http://slashdot.org/slashdot.rdf';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_rss;
   $slashdotnews = $all_news_line;

   #CNet - News, Communication, Personal Tech
   $url = 'http://rss.com.com/2547-12-0-5.xml';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_rss;
   $cnetnews = $all_news_line;
   $url      = 'http://rss.com.com/2547-1033-0-5.xml';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_rss;
   $cnetnews = $cnetnews . $all_news_line;
   $url      = 'http://rss.com.com/2547-1040-0-5.xml';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_rss;
   $cnetnews = $cnetnews . $all_news_line;

   #____________________________

   #http://www.politechbot.com/
   $url = 'http://www.politechbot.com/';
   &get_feed;
   $no_news_items = '15';
   &sort_feed_politechbot;
   $politechbotnews = $all_news_line;

   #http://www.wired.com/
   $url = 'http://www.wired.com';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_wired;
   $wirednews = $all_news_line;

   #http://online.securityfocus.com/archive/105 Security Focus-Security Basics
   $url = 'http://online.securityfocus.com/archive/105';
   &get_feed;
   $no_news_items = '20';
   &sort_feed_sf_mail_list;
   $secfocussecbasics = $all_news_line;

   #http://online.securityfocus.com/archive/1 Security Focus-BugTraq
   $url = 'http://online.securityfocus.com/archive/1';
   &get_feed;
   $no_news_items = '20';
   &sort_feed_sf_mail_list;
   $secfocusbugtraq = $all_news_line;

   #http://www.cnn.com/TECH/ CNN Technology
   # (http://csociety.purdue.org/~jacoby/XML/CNN_TECHNOLOGY.xml)
   $url = 'http://www.cnn.com/TECH/';
   &get_feed;
   $no_news_items = '30';
   &sort_feed_cnn_tech;
   $cnntechnologynews = $all_news_line;

   #http://www.mi2g.com/cgi/mi2g/media.php
   $url = 'http://www.mi2g.com/cgi/mi2g/media.php';
   &get_feed;
   $no_news_items = '15';
   &sort_feed_mi2g;
   $mi2gnews = $all_news_line;

   #eWeek - Labs, Security
   $url = 'http://www.eweek.com/category2/0,3960,93,00.asp';
   &get_feed;
   $no_news_items = '10';
   &sort_feed_eweek;
   $eweeknews = $all_news_line;
   $url       = 'http://www.eweek.com/category2/0,3960,96,00.asp';
   &get_feed;
   $no_news_items = '10';
   &sort_feed_eweek;
   $eweeknews = $eweeknews . $all_news_line;

   #Computer World - RSS Feed, Security News
   $url = 'http://www.computerworld.com/news/xml/0,5000,73,00.xml';
   &get_feed;
   $no_news_items = '6';
   &sort_feed_rss;
   $computerworldnews = $all_news_line;
   $url               = 'http://www.computerworld.com/securitytopics/'
                      . 'security/news/0,11188,KEY73,00.html';
   &get_feed;
   $no_news_items = '10';
   &sort_feed_computerworld;
   $computerworldnews = $computerworldnews . $all_news_line;

   #http://www.zone-h.org/ - Vaunrabilities, News
   $url = 'http://www.zone-h.org/backend/advigen.htm';
   &get_feed;
   $no_news_items = '4';
   &sort_feed_zoneh;
   $zonehvaun = $all_news_line;
   $url       = 'http://www.zone-h.org/backend/newsgen.htm';
   &get_feed;
   $no_news_items = '10';
   &sort_feed_zoneh;
   $zonehnews = $all_news_line;

}

#_______________________________________________________________________________

sub get_feed {
   @feed_lines   = '';
   $feed_content = '';
   use LWP::Simple;
   $content = get("$url");
   if ( defined $content ) {
      $feed_content = $content;
      $debug_info   = $debug_info . "\nGot:          $url\n";
   }
   else {
      $debug_info_error = $debug_info_error . "Couldn't Get: $url\n";
      $feed_content     = 'Error';
   }
   @feed_lines = split ( /$NL+/, $feed_content );
}    # end sub get feed

#_______________________________________________________________________________

#_______________________________________________________________________________

sub sort_feed_netsec {

   $error_code = '';
   if ( $feed_content eq 'Error' ) {
      $error_code = '-error unable to retrieve content-';
      &compile_complete_line_error;
   }
   else {
      if (@feed_lines) {
         $all_news_line = '';
         $news_url      = '';
         $news_url_info = '';
         $count         = '0';
         if (  ( $feed_content =~ /<a href="/o )
            && ( $feed_content =~ /" target="_blank">/o )
            && ( $feed_content =~ /<\/a><br>/o ) )
         {
            foreach $news_line (@feed_lines) {
               if (  ( $news_line =~ /<a href="/o )
                  && ( $news_line =~ /" target="_blank">/o )
                  && ( $news_line =~ /<\/a><br>/o ) )
               {
                  $news_url      = '';
                  $news_url_info = '';
                  $news_line =~ s/$NLT//g;
                  $news_line =~ s/<a href="//go;
                  $news_line =~ s/" target="_blank">/>/go;
                  $news_line =~ s/<\/a><br>//go;
                  ( $news_url, $news_url_info ) =
                    split ( />/o, $news_line );

                  if ( $no_news_items > $count ) {
                     &compile_complete_line;
                  }
                  $count++;
               }
            }
            $debug_info = $debug_info . "Recognised:   $url\n";
         }
         else {
            $debug_info_error = $debug_info_error . "Wrong Info:   $url\n";
            $error_code       = '-error content not recognised/no content-';
            &compile_complete_line_error;
         }
      }
   }
}

#_______________________________________________________________________________

sub sort_feed_zoneh {

   $error_code = '';
   if ( $feed_content eq 'Error' ) {
      $error_code = '-error unable to retrieve content-';
      &compile_complete_line_error;
   }
   else {
      if (@feed_lines) {
         $all_news_line = '';
         $news_url      = '';
         $news_url_info = '';
         $count         = '0';
         if (  ( $feed_content =~ /<a href="/o )
            && ( $feed_content =~ /">/o )
            && ( $feed_content =~ /<\/a><br>/o ) )
         {
            foreach $news_line (@feed_lines) {
               if (  ( $news_line =~ /<a href="/o )
                  && ( $news_line =~ /">/o )
                  && ( $news_line =~ /<\/a><br>/o ) )
               {
                  $news_url      = '';
                  $news_url_info = '';
                  $news_line =~ s/$NLT//g;
                  $news_line =~ s/<a href="//og;
                  $news_line =~ s/">/>/og;
                  $news_line =~ s/<\/a><br>//og;
                  ( $news_url, $news_url_info ) =
                    split ( />/o, $news_line );

                  if ( $no_news_items > $count ) {
                     &compile_complete_line;
                  }
                  $count++;
               }
            }
            $debug_info = $debug_info . "Recognised:   $url\n";
         }
         else {
            $debug_info_error = $debug_info_error . "Wrong Info:   $url\n";
            $error_code       = '-error content not recognised/no content-';
            &compile_complete_line_error;
         }
      }
   }
}

#_______________________________________________________________________________

sub sort_feed_rss {

   $error_code = '';

   if ( ($feed_content) && ( $feed_content eq 'Error' ) ) {
      $error_code = '-error unable to retrieve content-';
      &compile_complete_line_error;
   }
   else {

      if (@feed_lines) {

         $all_news_line = '';
         $news_url      = '';
         $news_url_info = '';
         $count         = '0';

         if (
               ( $feed_content =~ /<item>/io )
                  &&
               ( $feed_content =~ /<\/item>/io )
            )
         {
            $content =~ s/<i>//oig;
            $content =~ s/<\/i>//oig;
            $content =~ s/<b>//oig;
            $content =~ s/<\/b>//oig;
            $content =~ s/<\/a>//oig;
            $content =~ s/<font color=#"dd0000">//oig;
            $content =~ s/<\/font>//oig;
            $content =~ s/ & / &amp; /oig;
            $content =~ s/&command/&amp;command/oig;
            $content =~ s/&id/&amp;id/oig;
            $content =~ s/&op/&amp;op/oig;

            #$content  =~ s/&/&amp;/ig;

            my $rss = new XML::RSS;

            { local($@); eval { $rss->parse($content) }; warn($@) if $@ }

            $count         = '0';
            $all_news_line = '';

            foreach my $item ( @{ $rss->{'items'} } ) {

               next unless defined( $item->{'title'} )
                 && defined( $item->{'link'} );

               $news_url      = $item->{'link'};
               $news_url_info = $item->{'title'};

               if ( $count < $no_news_items ) {

                  if ( ($news_url) && ($news_url_info) ) {

                     &compile_complete_line_filter;
                  }
                  else {

                     $debug_info_error =
                     $debug_info_error
                     . "Module Error: $url\n";

                     $error_code = '-Module error, can not parse content-';

                     &compile_complete_line_error;
                  }
               }

               $count++;
            }

            $debug_info = $debug_info . "Recognised:   $url\n";
         }
         else {

            $debug_info_error = $debug_info_error . "Wrong Info:   $url\n";
            $error_code       = '-error content not recognised/no content-';

            &compile_complete_line_error;
         }
      }
   }
}

#_______________________________________________________________________________

sub sort_feed_politechbot {

   $error_code = '';
   if ( $feed_content eq 'Error' ) {
      $error_code = '-error unable to retrieve content-';
      &compile_complete_line_error;
   }
   else {
      if (@feed_lines) {
         $all_news_line = '';
         $news_url      = '';
         $news_url_info = '';
         $null          = '';
         $rest          = '';
         $count         = '0';
         if (  ( $feed_content =~ /href=\"/o )
            && ( $feed_content =~ /\"><strong> /o )
            && ( $feed_content =~ /<\/strong>/o ) )
         {
            foreach $news_line (@feed_lines) {
               if (  ( $news_line =~ /href=\"/o )
                  && ( $news_line =~ /\"><strong> /o )
                  && ( $news_line =~ /<\/strong>/o ) )
               {
                  $news_url      = '';
                  $news_url_info = '';
                  $news_line =~ s/$NLT//g;
                  ( $null,     $rest ) = split ( /href=\"/o,      $news_line );
                  ( $news_url, $rest ) = split ( /\"><strong> /o, $rest );
                  ( $news_url_info, $null, $rest ) =
                    split ( /<\/strong>/o, $rest );
                  $news_url = "http://www.politechbot.com/$news_url";

                  if ( $no_news_items > $count ) {
                     &compile_complete_line;
                  }
                  $count++;
               }
            }
            $debug_info = $debug_info . "Recognised:   $url\n";
         }
         else {
            $debug_info_error = $debug_info_error . "Wrong Info:   $url\n";
            $error_code       = '-error content not recognised/no content-';
            &compile_complete_line_error;
         }
      }
   }
}

#_______________________________________________________________________________

sub sort_feed_wired {

   $error_code = '';
   if ( $feed_content eq 'Error' ) {
      $error_code = '-error unable to retrieve content-';
      &compile_complete_line_error;
   }
   else {
      if (@feed_lines) {
         $all_news_line = '';
         $news_url      = '';
         $news_url_info = '';
         $null          = '';
         $rest          = '';
         $count         = '0';
         if (  ( $feed_content =~ /BEGIN Main Stories/o )
            && ( $feed_content =~ /END Story List/o ) )
         {
            ( $null, $rest ) =
              split ( /BEGIN Main Stories/o, $feed_content );
            ($rest) = split ( /END Story List/o, $rest );
            @feed_lines = split ( /$NL+/, $rest );

            foreach $news_line (@feed_lines) {
               if (  ( $news_line =~ /<p class=\"large\"><span>/o )
                  && ( $news_line =~ /<\/span><br \/> <a href=\'\//o )
                  && ( $news_line =~ /\'/o ) )
               {
                  $news_url      = '';
                  $news_url_info = '';
                  $news_line =~ s/$NLT//g;

                  ( $null, $rest ) = split ( /<span>/o, $news_line );
                  ( $news_url_info, $rest ) =
                    split ( /<\/span><br \/> <a href='\//o, $rest );
                  ($news_url) = split ( /\'/o, $rest );

                  $news_url = "http://www.wired.com/$news_url";
                  if ( $no_news_items > $count ) {
                     &compile_complete_line;
                  }
                  $count++;
               }
            }

            foreach $news_line (@feed_lines) {
               if (  ( $news_line =~ /<p> <a href=\'\//o )
                  && ( $news_line =~ /\' class=\"hd\">/o )
                  && ( $news_line =~ /<\/a>/o ) )
               {
                  $news_url      = '';
                  $news_url_info = '';
                  $news_line =~ s/$NLT//g;

                  ( $null, $rest ) = split ( /href=\'\//o, $news_line );
                  ( $news_url, $rest ) =
                    split ( /\' class=\"hd\">/o, $rest );
                  ($news_url_info) = split ( /<\/a>/o, $rest );
                  $news_url = "http://www.wired.com/$news_url";
                  if ( $no_news_items > $count ) {
                     &compile_complete_line;
                  }
                  $count++;
               }
            }

            $debug_info = $debug_info . "Recognised:   $url\n";
         }
         else {
            $debug_info_error = $debug_info_error . "Wrong Info:   $url\n";
            $error_code       = '-error content not recognised/no content-';
            &compile_complete_line_error;
         }
      }
   }
}

#_______________________________________________________________________________

sub sort_feed_sf_mail_list {

   $error_code = '';
   if ( $feed_content eq 'Error' ) {
      $error_code = '-error unable to retrieve content-';
      &compile_complete_line_error;
   }
   else {
      if (@feed_lines) {
         $all_news_line = '';
         $news_url      = '';
         $news_url_info = '';
         $null          = '';
         $rest          = '';
         $count         = '0';
         $pre = '<div style="margin-left: 0px"><a class="bulletlink" href="/';
         $mid = '">';
         $end = '</a></div>';

         if (  ( $feed_content =~ /$pre/o )
            && ( $feed_content =~ /$mid/o )
            && ( $feed_content =~ /$end/o ) )
         {
            foreach $news_line (@feed_lines) {
               if (  ( $news_line =~ /$pre/o )
                  && ( $news_line =~ /$mid/o )
                  && ( $news_line =~ /$end/o ) )
               {
                  $news_url      = '';
                  $news_url_info = '';
                  $news_line =~ s/$NLT//g;
                  ( $null,     $rest ) = split ( /$pre/o, $news_line );
                  ( $news_url, $rest ) = split ( /$mid/o, $rest );
                  ( $news_url_info, $null, $rest ) =
                    split ( /$end/o, $rest );
                  $news_url = "http://online.securityfocus.com/$news_url";

                  if ( $no_news_items > $count ) {
                     &compile_complete_line;
                  }
                  $count++;
               }
            }
            $debug_info = $debug_info . "Recognised:   $url\n";
         }
         else {
            $debug_info_error = $debug_info_error . "Wrong Info:   $url\n";
            $error_code       = '-error content not recognised/no content-';
            &compile_complete_line_error;
         }
      }
   }
}

#_______________________________________________________________________________

sub sort_feed_cnn_tech {

   $error_code = '';
   if ( $feed_content eq 'Error' ) {
      $error_code = '-error unable to retrieve content-';
      &compile_complete_line_error;
   }
   else {
      if (@feed_lines) {
         $all_news_line = '';
         $news_url      = '';
         $news_url_info = '';
         $null          = '';
         $rest          = '';
         $count         = '0';
         $pre           = '<a href="/';
         $mid           = '">';
         $end           = '</a>';

         if (  ( $feed_content =~ /cnnSectT2s/o )
            && ( $feed_content =~ /cnnBodyText/o ) )
         {
            ( $null, $rest ) = split ( /cnnSectT2s/o, $feed_content );
            ($rest) = split ( /<\/div>/o, $rest );
            @feed_lines = split ( /$NL+/, $rest );

            foreach $news_line (@feed_lines) {
               if (  ( $news_line =~ /$pre/o )
                  && ( $news_line =~ /$mid/o )
                  && ( $news_line =~ /$end/o ) )
               {
                  $news_url      = '';
                  $news_url_info = '';
                  $news_line =~ s/$NLT//og;
                  ( $null,     $rest ) = split ( /$pre/o, $news_line );
                  ( $news_url, $rest ) = split ( /$mid/o, $rest );
                  ( $news_url_info, $null, $rest ) =
                    split ( /$end/o, $rest );
                  $news_url = "http://www.cnn.com/$news_url";

                  if ( $no_news_items > $count ) {
                     &compile_complete_line;
                  }
                  $count++;
               }
            }
            $debug_info = $debug_info . "Recognised:   $url\n";
         }
         else {
            $debug_info_error = $debug_info_error . "Wrong Info:   $url\n";
            $error_code       = '-error content not recognised/no content-';
            &compile_complete_line_error;
         }
      }
   }
}

#_______________________________________________________________________________

sub sort_feed_mi2g {

   $error_code = '';
   if ( $feed_content eq 'Error' ) {
      $error_code = '-error unable to retrieve content-';
      &compile_complete_line_error;
   }
   else {
      if (@feed_lines) {
         $all_news_line      = '';
         $news_url           = '';
         $news_url_info      = '';
         $null               = '';
         $rest               = '';
         $count              = '0';
         $pre                = '<a href="';
         $mid                = '">';
         $end                = '</a>';
         $feed_section_split = '<tr>';
         if (  ( $feed_content =~ /$pre/o )
            && ( $feed_content =~ /$mid/o )
            && ( $feed_content =~ /$end/o )
            && ( $feed_content =~ /$feed_section_split/o ) )
         {

            $feed_content =~ s/$NLT//g;
            $feed_content =~ s/   / /og;
            $feed_content =~ s/     / /og;
            $feed_content =~ s/ target="_blank"//og;
            $feed_content =~ s/<font size=-1 face="arial">//og;
            @feed_lines = split ( /<tr>/o, $feed_content );

            foreach $news_line (@feed_lines) {
               if (  ( $news_line =~ /$pre/o )
                  && ( $news_line =~ /$mid/o )
                  && ( $news_line =~ /$end/o )
                  && ( $news_line =~ /press/o ) )
               {
                  if ( $news_line =~ /img/o ) {
                     ( $null, $news_line ) = split ( /img/o, $news_line );
                  }

                  $news_url      = '';
                  $news_url_info = '';
                  ( $null,     $rest ) = split ( /$pre/o, $news_line );
                  ( $news_url, $rest ) = split ( /$mid/o, $rest );
                  ( $news_url_info, $null, $rest ) =
                    split ( /$end/o, $rest );
                  $news_url = "http://www.mi2g.com$news_url";
                  $news_url =~ s/compress/com\/cgi\/mi2g\/press/og;
                  if ( $no_news_items > $count ) {
                     &compile_complete_line;
                  }
                  $count++;
               }
            }
            $debug_info = $debug_info . "Recognised:   $url\n";
         }
         else {
            $debug_info_error = $debug_info_error . "Wrong Info:   $url\n";
            $error_code       = '-error content not recognised/no content-';
            &compile_complete_line_error;
         }
      }
   }
}

#_______________________________________________________________________________

sub sort_feed_eweek {

   $error_code = '';
   if ( $feed_content eq 'Error' ) {
      $error_code = '-error unable to retrieve content-';
      &compile_complete_line_error;
   }
   else {
      if (@feed_lines) {
         $all_news_line = '';
         $news_url      = '';
         $news_url_info = '';
         $null          = '';
         $rest          = '';
         $count         = '0';
         $pre           = '<a href="';
         $mid           = '" class= "HEADERMEDIUM">';
         $end           = '</a>';
         $feed_content =~ s/class="HEADERXLARGE"/class= "HEADERMEDIUM"/og;
         $feed_content =~
           s/><div class="bodycopymedium"/ class= "HEADERMEDIUM"/og;

         if (  ( $feed_content =~ /$pre/o )
            && ( $feed_content =~ /$mid/o )
            && ( $feed_content =~ /$end/o ) )
         {
            $feed_content =~ s/$NLT//og;
            foreach $news_line (@feed_lines) {
               $news_line =~ s/<\/div>//og;
               $news_line =~ s/class="HEADERXLARGE"/class= "HEADERMEDIUM"/og;
               $news_line =~
                 s/><div class="bodycopymedium"/ class= "HEADERMEDIUM"/og;
               if (  ( $news_line =~ /$pre/o )
                  && ( $news_line =~ /$mid/o )
                  && ( $news_line =~ /$end/o ) )
               {
                  if ( $news_line =~ /img/o ) {
                     ( $null, $news_line ) = split ( /img/o, $news_line );
                  }
                  $news_url      = '';
                  $news_url_info = '';
                  ( $null,     $rest ) = split ( /$pre/o, $news_line );
                  ( $news_url, $rest ) = split ( /$mid/o, $rest );
                  ( $news_url_info, $null, $rest ) =
                    split ( /$end/o, $rest );
                  unless ( $news_url_info =~ /font/o ) {
                     if ( $no_news_items > $count ) {
                        &compile_complete_line;
                     }
                     $count++;
                  }
               }
            }
            $debug_info = $debug_info . "Recognised:   $url\n";
         }
         else {
            $debug_info_error = $debug_info_error . "Wrong Info:   $url\n";
            $error_code       = '-error content not recognised/no content-';
            &compile_complete_line_error;
         }
      }
   }
}

#_______________________________________________________________________________

sub sort_feed_computerworld {

   $error_code = '';
   if ( $feed_content eq 'Error' ) {
      $error_code = '-error unable to retrieve content-';
      &compile_complete_line_error;
   }
   else {
      if (@feed_lines) {
         $all_news_line = '';
         $news_url      = '';
         $news_url_info = '';
         $null          = '';
         $rest          = '';
         $count         = '0';
         $pre           = '<a href="';
         $mid           =
            '" class="heads10">'
            . '<img src="/computerworld/images/blue_square.gif" '
            . 'width="10" height="8" border="0"><b>';
         $end                = '</b></a>';
         $feed_section_split = '<br>';

         $feed_content =~ s/$NLT//g;

         if (  ( $feed_content =~ /$pre/o )
            && ( $feed_content =~ /$mid/o )
            && ( $feed_content =~ /$end/o )
            && ( $feed_content =~ /$feed_section_split/o ) )
         {

            @feed_lines = split ( /$feed_section_split/o, $feed_content );
            foreach $news_line (@feed_lines) {
               if (  ( $news_line =~ /$pre/o )
                  && ( $news_line =~ /$mid/o )
                  && ( $news_line =~ /$end/o )
                  && ( $news_line =~ /heads10/o ) )
               {
                  $news_url      = '';
                  $news_url_info = '';
                  ( $null,     $rest ) = split ( /$pre/o, $news_line );
                  ( $news_url, $rest ) = split ( /$mid/o, $rest );
                  ( $news_url_info, $null, $rest ) =
                    split ( /$end/o, $rest );
                  $news_url = "http://www.computerworld.com$news_url";
                  if ( $no_news_items > $count ) {
                     &compile_complete_line;
                  }
                  $count++;
               }
            }
            $debug_info = $debug_info . "Recognised:   $url\n";
         }
         else {
            $debug_info_error = $debug_info_error . "Wrong Info:   $url\n";
            $error_code       = '-error content not recognised/no content-';
            &compile_complete_line_error;
         }
      }
   }
}

#_______________________________________________________________________________

sub compile_complete_line_filter {

   unless ( $news_url_info =~ /SUPPORT EFF/o ) {
      &compile_complete_line;
   }

}

sub compile_complete_line {
   $all_news_line =
     $all_news_line
     . "  <tr><td width=\"10\" nowrap valign=\"top\">"
     . "<p align=\"left\">&#9658;</td><td>"
     . "<a target=\"_blank\" class=\"news_link\" href="
     . "\"$news_url\">$news_url_info</a></td></tr>"
     . "\n";
}

sub compile_complete_line_error {
   $all_news_line =
   "  <tr><td width=\"10\" nowrap valign=\"top\">"
   . "<p align=\"left\">&#9658;</td><td>$error_code</td></tr>"
   . "\n";
}

#_______________________________________________________________________________

sub save_feeds_html_page {

   &read_template;
   &date_time;
   &read_news_feeds;
   &save_news_feed_html_page;

   ##### Read in news feeds to template
   sub read_news_feeds {

      $pattern1 =
'<tr><td width="10" nowrap valign="top"><p align="left">&#9658;</td><td>';
      $template =~ s/$pattern1//go;
      $pattern2 = '</td></tr>';
      $template =~ s/$pattern2//go;
      if ($lastupdateddatetimegmt) {
         $template =~ s/lastupdateddatetimegmt/$lastupdateddatetimegmt/go;
      }
      if ($lastupdateddatetimeest) {
         $template =~ s/lastupdateddatetimeest/$lastupdateddatetimeest/go;
      }

      $error_code = '-error feed offline-';
      &compile_complete_line_error;
      if ($netsecuritynews) {
         $template =~ s/netsecuritynews/$netsecuritynews/go;
      }
      else { $template =~ s/netsecuritynews/$all_news_line/go; }
      if ($netsecurityvaul) {
         $template =~ s/netsecurityvaul/$netsecurityvaul/go;
      }
      else { $template =~ s/netsecurityvaul/$all_news_line/go; }
      if ($netsecurityadvi) {
         $template =~ s/netsecurityadvi/$netsecurityadvi/go;
      }
      else { $template =~ s/netsecurityadvi/$all_news_line/go; }
      if ($certnews) { $template =~ s/certnews/$certnews/go; }
      else { $template =~ s/certnews/$all_news_line/go; }
      if ($hackintheboxnews) {
         $template =~ s/hackintheboxnews/$hackintheboxnews/go;
      }
      else { $template =~ s/hackintheboxnews/$all_news_line/go; }
      if ($theregisternews) {
         $template =~ s/theregisternews/$theregisternews/go;
      }
      else { $template =~ s/theregisternews/$all_news_line/go; }
      if ($newsforgenews) { $template =~ s/newsforgenews/$newsforgenews/go; }
      else { $template =~ s/newsforgenews/$all_news_line/go; }
      if ($wirednews) { $template =~ s/wirednews/$wirednews/go; }
      else { $template =~ s/wirednews/$all_news_line/go; }
      if ($slashdotnews) { $template =~ s/slashdotnews/$slashdotnews/go; }
      else { $template =~ s/slashdotnews/$all_news_line/go; }

      if ($effmediareleasesnews) {
         $template =~ s/effmediareleasesnews/$effmediareleasesnews/go;
      }
      else { $template =~ s/effmediareleasesnews/$all_news_line/go; }
      if ($effactionalertsnews) {
         $template =~ s/effactionalertsnews/$effactionalertsnews/go;
      }
      else { $template =~ s/effactionalertsnews/$all_news_line/go; }
      if ($politechbotnews) {
         $template =~ s/politechbotnews/$politechbotnews/go;
      }
      else { $template =~ s/politechbotnews/$all_news_line/go; }
      if ($secnewsportalnews) {
         $template =~ s/secnewsportalnews/$secnewsportalnews/go;
      }
      else { $template =~ s/secnewsportalnews/$all_news_line/go; }
      if ($secfocussecbasics) {
         $template =~ s/secfocussecbasics/$secfocussecbasics/go;
      }
      else { $template =~ s/secfocussecbasics/$all_news_line/go; }
      if ($secfocusbugtraq) {
         $template =~ s/secfocusbugtraq/$secfocusbugtraq/go;
      }
      else { $template =~ s/secfocusbugtraq/$all_news_line/go; }
      if ($cnntechnologynews) {
         $template =~ s/cnntechnologynews/$cnntechnologynews/go;
      }
      else { $template =~ s/cnntechnologynews/$all_news_line/go; }
      if ($cnetnews) { $template =~ s/cnetnews/$cnetnews/go; }
      else { $template =~ s/cnetnews/$all_news_line/go; }
      if ($mi2gnews) { $template =~ s/mi2gnews/$mi2gnews/go; }
      else { $template =~ s/mi2gnews/$all_news_line/go; }
      if ($eweeknews) { $template =~ s/eweeknews/$eweeknews/go; }
      else { $template =~ s/eweeknews/$all_news_line/go; }

      if ($computerworldnews) {
         $template =~ s/computerworldnews/$computerworldnews/go;
      }
      else { $template =~ s/computerworldnews/$all_news_line/go; }
      if ($zonehvaun) { $template =~ s/zonehvaun/$zonehvaun/go; }
      else { $template =~ s/zonehvaun/$all_news_line/go; }
      if ($zonehnews) { $template =~ s/zonehnews/$zonehnews/go; }
      else { $template =~ s/zonehnews/$all_news_line/go; }

   }    ##### End sub read_news_feeds

   ##### Read in page template
   sub read_template { $template = <<__READ_TEMPLATE__ }
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta
       http-equiv="Content-Language"
       content="en-gb" />
      <meta
       http-equiv="Content-Type"
       content="text/html; charset=windows-1252" />

      <title>Combined News Feeds</title>
<style
type="text/css" xml:space="preserve">
A.news_link:link    {color: #000000; TEXT-DECORATION: none; font-size: 10pt}
A.news_link:visited {color: #808080; TEXT-DECORATION: none; font-size: 10pt}
A.news_link:hover   {color: #0000FF; TEXT-DECORATION: none; font-size: 10pt}
.body_content { font-family: Arial; }
</style>
<style
type="text/css" xml:space="preserve">
body {
  background-color: #7F0000;
}
table.c3 {border-collapse: collapse}
p.c2 {text-align: left}
p.c1 {text-align: center}
</style>
   </head>

   <body>
      <table
       border="0"
       cellpadding="0"
       cellspacing="10"
       class="c3"
       bordercolor="#111111"
       width="100%"
       id="AutoNumber1"
       bgcolor="#7F0000">
         <tr>
            <td
             width="100%"
             colspan="5"
             bgcolor="#FFFFFF">
               <p
                class="c1"><strong>==&gt; C-O-M-B-I-N-E-D&#160; N-E-W-S&#160;
               F-E-E-D-S&#160; C-O-N-S-O-L-E &lt;==</strong></p>
            </td>
         </tr>

         <tr>
            <td
             width="20%">
               <p>&#160;</p>
            </td>

            <td
             width="20%">
               <p>&#160;</p>
            </td>

            <td
             width="20%">
               <p>&#160;</p>
            </td>

            <td
             width="20%">
               <p>&#160;</p>
            </td>

            <td
             width="20%">
               <p>&#160;</p>
            </td>
         </tr>

         <tr>
            <td
             width="20%"
             class="body_content"
             bgcolor="#7F0000"
             valign="top">
               <table
                border="0"
                cellpadding="0"
                cellspacing="0"
                width="100%"
                id="AutoNumber2"
                bgcolor="#FFFFFF"
                class="body_content c3">
                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Wired</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>wirednews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Security News Portal</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>secnewsportalnews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Net-Security News</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>netsecuritynews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Net-Security Advisories</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>netsecurityadvi</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Net-Security Vulnerabilities</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>netsecurityvaul</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Zone-H Vulnerabilities</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>zonehvaun</p>
                     </td>
                  </tr>
               </table>
            </td>

            <td
             width="20%"
             class="body_content"
             bgcolor="#7F0000"
             valign="top">
               <table
                border="0"
                cellpadding="0"
                cellspacing="0"
                width="100%"
                id="AutoNumber2"
                bgcolor="#FFFFFF"
                class="body_content c3">
                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>The Register</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p
                         class="c2">º</p>
                     </td>

                     <td>
                        <p>theregisternews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>CNN Technology</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p
                         class="c2">º</p>
                     </td>

                     <td>
                        <p>cnntechnologynews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>eWeek Labs / Security News</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p
                         class="c2">º</p>
                     </td>

                     <td>
                        <p>eweeknews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>CNet News</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>cnetnews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Zone-H News</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>zonehnews</p>
                     </td>
                  </tr>
               </table>
            </td>

            <td
             width="20%"
             class="body_content"
             bgcolor="#7F0000"
             valign="top">
               <table
                border="0"
                cellpadding="0"
                cellspacing="0"
                width="100%"
                id="AutoNumber2"
                bgcolor="#FFFFFF"
                class="body_content c3">
                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Hack In The Box</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>hackintheboxnews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>CERT</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>certnews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Computer World Security News</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>computerworldnews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>EFF News</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>effmediareleasesnews</p>
                     </td>
                  </tr>
               </table>
            </td>

            <td
             width="20%"
             class="body_content"
             bgcolor="#7F0000"
             valign="top">
               <table
                border="0"
                cellpadding="0"
                cellspacing="0"
                width="100%"
                id="AutoNumber2"
                bgcolor="#FFFFFF"
                class="body_content c3">
                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>PoliTech</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>politechbotnews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>SlashDot</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>slashdotnews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>mi2g News</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>mi2gnews</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>EFF Alerts</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>effactionalertsnews</p>
                     </td>
                  </tr>
               </table>
            </td>

            <td
             width="20%"
             class="body_content"
             bgcolor="#7F0000"
             valign="top">
               <table
                border="0"
                cellpadding="0"
                cellspacing="0"
                width="100%"
                id="AutoNumber2"
                bgcolor="#FFFFFF"
                class="body_content c3">
                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Security Focus BugTraq</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>secfocusbugtraq</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>Security Focus Security Basics</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>secfocussecbasics</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      colspan="2">
                        <p>News Forge</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="100%"
                      bgcolor="#7F0000"
                      colspan="2">
                        <p>&#160;</p>
                     </td>
                  </tr>

                  <tr>
                     <td
                      width="10"
                      nowrap="nowrap"
                      valign="top">
                        <p class="c2">º</p>
                     </td>

                     <td>
                        <p>newsforgenews</p>
                     </td>
                  </tr>
               </table>
            </td>
         </tr>

         <tr>
            <td
             width="100%"
             class="body_content"
             valign="top"
             colspan="5">
               <p>&#160;</p>
            </td>
         </tr>

         <tr>
            <td
             width="100%"
             class="body_content"
             bgcolor="#FFFFFF"
             valign="top"
             colspan="5">
               <p>Last Updated: lastupdateddatetimegmt GMT
               (lastupdateddatetimeest EST)</p>
            </td>
         </tr>
      </table>
   </body>
</html>
__READ_TEMPLATE__

   sub save_news_feed_html_page {
      open( DAT, ">$html_page" )
        or ( $debug_info_error =
         $debug_info_error . "Save Error:   $html_page\n" );
      print DAT "$template";
      close(DAT);
      $debug_info = $debug_info . "\nSaved File:  $html_page\n";
   }

   sub date_time {

      $wday = '';
      $yday = '';
      ( $sec, $min, $hr, $mday, $mon, $year, $wday, $yday ) = localtime(time);
      $longyr = $year + 1900;
      $fixmo  = $mon + 1;

      if ( $mday < 10 )  { $mday  = "0$mday"; }
      if ( $fixmo < 10 ) { $fixmo = "0$fixmo"; }
      if ( $hr < 10 )    { $hr    = "0$hr"; }
      if ( $min < 10 )   { $min   = "0$min"; }
      if ( $sec < 10 )   { $sec   = "0$sec"; }

      $lastupdateddatetimegmt = "$mday/$fixmo/$longyr \@ $hr:$min:$sec";

      %conv = qw(
         23    18    24    19    00    19    01    20    02    21
         03    22    04    23    05    24    06    01    07    02
         08    03    09    04    10    05    11    06    12    07
         13    08    14    09    15    10    16    11    17    12
         18    13    19    14    20    15    21    16    22    17
      );

      $lastupdateddatetimeest = "$conv{\"$hr\"}:$min:$sec";
   }
}

#_______________________________________________________________________________

#http://www.freesticky.com/stickyweb/articles/perlharnessxml.asp
#http://perlmonks.thepen.com/168684.html
#http://www.webreference.com/perl/tutorial/8/rss2html.pl
#http://www.mnot.net/rss/tutorial/
#http://search.cpan.org/src/EISEN/XML-RSS-0.96/examples/
#http://www.webreference.com/perl/tutorial/8/rss2html.pl
#http://www.perl.com/pub/a/2001/11/15/creatingrss.html
#http://blogspace.com/rss/readers
#http://www.oasis-open.org/cover/perl-xml-faq11.html

#_______________________________________________________________________________