/[Grep]/lib/Grep/Source/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

Diff of /lib/Grep/Source/Feed.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 109 by dpavlin, Sun Mar 4 23:29:37 2007 UTC revision 110 by dpavlin, Wed Mar 14 20:02:19 2007 UTC
# Line 11  use Data::Dump qw/dump/; Line 11  use Data::Dump qw/dump/;
11    
12  =head2 fetch  =head2 fetch
13    
14    Grep::Source::Feed->fetch( $source );    Grep::Source::Feed->fetch( $source_obj );
15    
16  =cut  =cut
17    
18  sub fetch {  sub fetch {
19          my $self = shift;          my $self = shift;
20    
21          my $parent = shift;          my $parent = shift || $self->log->confess('no parent?');
22          my ($feed,$uri) = ($parent->feed, $parent->uri);          my ($feed,$uri) = ($parent->feed, $parent->uri);
23          die "no uri" unless ($uri);          die "no uri" unless ($uri);
24          die "feed is not a Grep::Model::Feed but ", ref $feed unless $feed->isa('Grep::Model::Feed');          die "feed is not a Grep::Model::Feed but ", ref $feed unless $feed->isa('Grep::Model::Feed');
# Line 36  sub fetch { Line 36  sub fetch {
36          my $xml_feed = XML::Feed->parse( \$content )          my $xml_feed = XML::Feed->parse( \$content )
37                  or die $feed->title, " returned ", XML::Feed->errstr, "\n";                  or die $feed->title, " returned ", XML::Feed->errstr, "\n";
38    
39          $self->log->debug("getting entries from ", $xml_feed->title);          $self->log->debug("getting ", scalar $xml_feed->entries, " entries from ", $xml_feed->format, " feed ", $xml_feed->title);
40    
41          for my $entry ($xml_feed->entries) {          for my $entry ($xml_feed->entries) {
42    

Legend:
Removed from v.109  
changed lines
  Added in v.110

  ViewVC Help
Powered by ViewVC 1.1.26