package SGN::View::Mason::Commands;
use strict;
use vars qw($m $c);
HTML::Mason::Component::FileBased->new(
'code' => sub {
use utf8; local $SGN::View::Mason::Commands::m = $HTML::Mason::Commands::m;
HTML::Mason::Exception::Params->throw
    ( error =>
      "Odd number of parameters passed to component expecting name/value pairs"
    ) if @_ % 2;
my ( $uri );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( uri ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 3 "/home/production/cxgn/sgn/mason/feed/xmlfeed.mas"
    $uri = $_[ $pos{'uri'} ];
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/feed/xmlfeed.mas"
$m->print( '
' );
#line 5 "/home/production/cxgn/sgn/mason/feed/xmlfeed.mas"
$m->print( '
' );
#line 6 "/home/production/cxgn/sgn/mason/feed/xmlfeed.mas"


use XML::Feed;

my $feed = XML::Feed->parse(URI->new($uri));

if (! $feed) { 
  print "The news feed is currently not available.<br />\n";
  return;
}

foreach my $e ($feed->entries) { 
  my $dt = $e->issued();
  my $title = $e->title;
  $title =~ s/[^\x00-\x7E]//g;
  print  "<p><a  href=\"".$e->link()."\">$title</a> [".$dt->year."/".$dt->month."/".$dt->day."]</p>";
}
#line 24 "/home/production/cxgn/sgn/mason/feed/xmlfeed.mas"
$m->print( '

' );
;return;
},
'declared_args' => {
  '$uri' => { default => undef }
},
'load_time' => 1763079528,

)
;