use Encode; use LWP::Simple; use XML::XPath; use XML::XPath::XMLParser; use DateTime; use DateTime::Format::HTTP; my $rss = LWP::Simple::get( 'http://news.nicovideo.jp/media/article/1?rss=2.0' ); my $xml = XML::XPath->new( $rss ); my $nodeset = $xml->find('/rss/channel//item'); foreach my $node ( $nodeset->get_nodelist() ) { my $mdt = (DateTime::Format::HTTP->parse_datetime( $xml->find('pubDate',$node)->string_value() ) )->ymd('-'); my $title = encode( 'euc-jp',$xml->find('title',$node)->string_value() ); my $desc = encode( 'euc-jp',$xml->find('link',$node)->string_value() ); printf("%s\t%s\t%s\n",$mdt,$title,$desc); }