blib/lib/Libertatea/RSSreader.pm

filter: Statementstmt 85.7% 12 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 89.4% 17 / 19 CC 1 SCAR 0.6
CC
1
Cov
86%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
↑ Summary
1 package Libertatea::RSSreader;
2  
3 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 0 ▶use XML::Feed;
Subroutine BEGIN: called CC=1 SCAR=2.6
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__
↑ Summary