CNN.pm

filter: Statementstmt 100% 42 / 42 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 13 / 13 Podpod n/a totaltotal 100% 55 / 55 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« CNN/Base.pm ↑ Summary CNN/AllPolitics.pm »
1 package Feed::Data::CNN;
2  
3 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '0.03';
8  
9 2 ▶use Rope;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Rope::Autoload;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Feed::Data::CNN::TopStories;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Feed::Data::CNN::AllPolitics;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use Feed::Data::CNN::Health;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use Feed::Data::CNN::Tech;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 2 ▶use Feed::Data::CNN::Showbiz;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 2 for my $feed (qw/top_stories all_politics health tech showbiz/) {
18 property $feed => (
19 initable => 1,
20 enumerable => 1,
21 writeable => 0,
22 configurable => 1,
23 builder => sub {
24 5 ▶ _feed_info($_[0], $feed);
Subroutine __ANON__: called CC=1 SCAR=0.0
25 }
26 10 );
27 }
28  
29 sub _feed_info {
30 5 ▶ my @info = $_[0]->{properties}->{feed_info}->{value}(undef, $_[1]);
Subroutine _feed_info: called CC=1 SCAR=0.0
31 5 $info[0]->new(
32 url => $info[1]
33 );
34 }
35  
36 function feed_info => sub {
37 5 ▶ my ($self, $locale) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
38 5 (my $mod = $locale) =~ s/_([^_]+)/ucfirst($1)/eg;
39 5 $locale =~ s/_//g;
40 return (
41 5 sprintf("Feed::Data::CNN::%s", ucfirst($mod)),
42 sprintf("http://rss.cnn.com/rss/cnn_%s.rss", $locale)
43 );
44 2 };
45  
46  
47 2 1;
48  
49 __END__
50  
51 =head1 NAME
52  
53 Feed::Data::CNN - CNN rss feeds.
54  
55 =head1 VERSION
56  
57 Version 0.03
58  
59 =cut
60  
61 =head1 SYNOPSIS
62  
63 use Feed::Data::CNN;
64  
65 my $cnn = Feed::Data::CNN->new();
66  
67 for my $feed (qw/top_stories all_politics health tech showbiz/) {
68 my $data = $cnn->$feed;
69 $data->parse;
70 $data->render;
71 }
72  
73 =head1 SUBROUTINES/METHODS
74  
75 =head2 top_stories
76  
77 =head2 all_politics
78  
79 =head2 health
80  
81 =head2 tech
82  
83 =head2 showbiz
84  
85 See L<Feed::Data> for more information.
86  
87 =head1 AUTHOR
88  
89 LNATION, C<< <email at lnation.org> >>
90  
91 =head1 BUGS
92  
93 Please report any bugs or feature requests to C<bug-feed-data-cnn at rt.cpan.org>, or through
94 the web interface at L<https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Feed-Data-CNN>. I will be notified, and then you'll
95 automatically be notified of progress on your bug as I make changes.
96  
97 =head1 SUPPORT
98  
99 You can find documentation for this module with the perldoc command.
100  
101 perldoc Feed::Data::CNN
102  
103 You can also look for information at:
104  
105 =over 4
106  
107 =item * RT: CPAN's request tracker (report bugs here)
108  
109 L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=Feed-Data-CNN>
110  
111 =item * CPAN Ratings
112  
113 L<https://cpanratings.perl.org/d/Feed-Data-CNN>
114  
115 =item * Search CPAN
116  
117 L<https://metacpan.org/release/Feed-Data-CNN>
118  
119 =back
120  
121 =head1 ACKNOWLEDGEMENTS
122  
123 =head1 LICENSE AND COPYRIGHT
124  
125 This software is Copyright (c) 2024 by LNATION.
126  
127 This is free software, licensed under:
128  
129 The Artistic License 2.0 (GPL Compatible)
130  
131 =cut
132  
133 1; # End of Feed::Data::CNN
« CNN/Base.pm ↑ Summary CNN/AllPolitics.pm »