| 1 | # | ||||||||||
| 2 | # $Id: Feeds.pm 13 2008-04-30 09:30:13Z esobchenko $ | ||||||||||
| 3 | |||||||||||
| 4 | package REST::Google::Feeds; | ||||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use version; our $VERSION = qv('1.0.8'); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 2 | require Exporter; | |||||||||
| 12 | 2 | require REST::Google; | |||||||||
| 13 | 2 | ▶ | use base qw/Exporter REST::Google/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 2 | __PACKAGE__->service('http://ajax.googleapis.com/ajax/services/feed/load'); | |||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | sub responseData { | ||||||||
|
Subroutine
responseData: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 18 | 0 | my $self = shift; | |||||||||
| 19 | 0 | return bless $self->{responseData}, 'REST::Google::Feeds::Data'; | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | package # hide from CPAN | ||||||||||
| 23 | REST::Google::Feeds::Data; | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub feed { | ||||||||
|
Subroutine
feed: not called CC=1 SCAR=6.9
| |||||||||||
| 26 | 0 | my $self = shift; | |||||||||
| 27 | 0 | return bless $self->{feed}, 'REST::Google::Feeds::Feed'; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | package # hide from CPAN | ||||||||||
| 31 | REST::Google::Feeds::Feed; | ||||||||||
| 32 | |||||||||||
| 33 | 2 | require Class::Accessor; | |||||||||
| 34 | 2 | ▶ | use base qw/Class::Accessor/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 35 | |||||||||||
| 36 | { | ||||||||||
| 37 | 2 | my @fields = qw( | |||||||||
| 38 | title | ||||||||||
| 39 | link | ||||||||||
| 40 | author | ||||||||||
| 41 | description | ||||||||||
| 42 | type | ||||||||||
| 43 | ); | ||||||||||
| 44 | |||||||||||
| 45 | 2 | __PACKAGE__->mk_ro_accessors(@fields); | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 0 | ▶ | sub entries { | ||||||||
|
Subroutine
entries: not called CC=2 SCAR=17.9
| |||||||||||
| 49 | 0 | my $self = shift; | |||||||||
| 50 | 0 | ▶ | if (wantarray) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | 0 | return map { bless $_, 'REST::Google::Feeds::Entry' } @{ $self->{entries} }; | |||||||||
| 52 | } | ||||||||||
| 53 | 0 | [ map { bless $_, 'REST::Google::Feeds::Entry' } @{ $self->{entries} } ]; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | package # hide from CPAN | ||||||||||
| 57 | REST::Google::Feeds::Entry; | ||||||||||
| 58 | |||||||||||
| 59 | 2 | require Class::Accessor; | |||||||||
| 60 | 2 | ▶ | use base qw/Class::Accessor/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 61 | |||||||||||
| 62 | { | ||||||||||
| 63 | 2 | my @fields = qw( | |||||||||
| 64 | title | ||||||||||
| 65 | link | ||||||||||
| 66 | author | ||||||||||
| 67 | publishedDate | ||||||||||
| 68 | contentSnippet | ||||||||||
| 69 | content | ||||||||||
| 70 | categories | ||||||||||
| 71 | ); | ||||||||||
| 72 | |||||||||||
| 73 | 2 | __PACKAGE__->mk_ro_accessors(@fields); | |||||||||
| 74 | } | ||||||||||
| 75 | |||||||||||
| 76 | 2 | 1; | |||||||||