/[Frey]/branches/mojo/lib/Frey/Feed.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /branches/mojo/lib/Frey/Feed.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 248 - (hide annotations)
Tue Nov 4 17:26:26 2008 UTC (15 years, 6 months ago) by dpavlin
File size: 588 byte(s)
wrap Data::Feed into itrospectable object
1 dpavlin 248 package Frey::Feed;
2     use Moose;
3    
4     =head1 NAME
5    
6     Frey::Feed - represent RSS/Atom feed using L<Data::Feed>
7    
8     =cut
9    
10     use Data::Feed;
11     use Frey::Types;
12    
13     has uri => (
14     is => 'rw',
15     isa => 'Uri', coerce => 1,
16     required => 1,
17     );
18    
19     has feed => (
20     is => 'ro',
21     lazy => 1,
22     default => sub {
23     my ($self) = @_;
24     warn "parse ", $self->uri;
25     Data::Feed->parse( $self->uri );
26     },
27     );
28    
29     has title => (
30     is => 'ro',
31     lazy => 1,
32     default => sub { $_[0]->feed->title }
33     );
34    
35     use Data::Dump qw/dump/;
36     sub data {
37     my ($self) = @_;
38     warn "data ",$self->uri," ",dump($self->feed->entries);
39     $self->feed->entries;
40     }
41    
42     1;

  ViewVC Help
Powered by ViewVC 1.1.26