File Coverage

blib/lib/Libertatea/RSSreader.pm
Criterion Covered Total %
statement 12 14 85.7
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 17 19 89.4


line stmt bran cond sub pod time code
1             package Libertatea::RSSreader;
2              
3 1     1   23609 use 5.010;
  1         3  
4 1     1   6 use strict;
  1         1  
  1         28  
5 1     1   9 use warnings;
  1         5  
  1         27  
6 1     1   874 use utf8;
  1         10  
  1         5  
7 1     1   435 use XML::Feed;
  0            
  0            
8             use Carp;
9              
10             require Exporter;
11             our @ISA = qw(Exporter);
12             our %EXPORT_TAGS = ( 'all' => [ qw() ] );
13             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
14             our @EXPORT = qw(Libertatea);
15              
16             our $VERSION = '0.01';
17              
18             sub Libertatea {
19             my $feed = XML::Feed->parse(URI->new('http://www.libertatea.ro/rss.html'))
20             or die XML::Feed->errstr;
21             # Linia scrie outputul cu codarea literelot romanesti
22             open FILE, ">:utf8", "libertatea.txt" or die $!;
23             print FILE "--------------------".$feed->title."-----------------------\n";
24             for my $entry ($feed->entries) {
25             print FILE "TITLUL: ".$entry->title, "\n";
26             #print "SUMAR: ".$entry->summary,"\n";
27             print FILE "LINK: ".$entry->link, "\n\n";
28             #print "-----------------------------------------------------\n";
29             #print $entry->base, "\n";
30             }
31             close FILE;
32             }
33             1;
34             __END__