/[Grep]/lib/Grep/Action/Fetch.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/Action/Fetch.pm

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

revision 24 by dpavlin, Sun Feb 18 15:07:03 2007 UTC revision 25 by dpavlin, Sun Feb 18 20:45:59 2007 UTC
# Line 38  use Jifty::Action schema { Line 38  use Jifty::Action schema {
38                          }];                          }];
39                  };                  };
40    
41            param item_fragment =>
42                    label is 'Show',
43                    render as 'select',
44                    valid are qw/result result_short/,
45                    available are qw/result result_short/;
46    
47  };  };
48    
49  =head2 take_action  =head2 take_action
# Line 75  sub take_action { Line 81  sub take_action {
81          my $ua = LWP::UserAgent->new;          my $ua = LWP::UserAgent->new;
82          $ua->default_header( 'Cookie' => $feed->cookie );          $ua->default_header( 'Cookie' => $feed->cookie );
83          my $r = $ua->get( $uri );          my $r = $ua->get( $uri );
84          die "Can't fetch $uri: " . $r->status_line unless ( $r->is_success );          die $feed->title . " returned " . $r->status_line . " for $uri\n" unless ( $r->is_success );
85    
86          my $content = $r->content;          my $content = $r->content;
87    
# Line 103  sub take_action { Line 109  sub take_action {
109                          modified => $entry->modified ? $entry->modified->strftime("%Y-%m-%d %H:%M:%S %z") : undef,                          modified => $entry->modified ? $entry->modified->strftime("%Y-%m-%d %H:%M:%S %z") : undef,
110                  );                  );
111    
112                  die "can't create item from entry ", dump( $entry ) unless ( $i->id );                  if ( $i->id ) {
113                            push @items, $i;
114    
115                  push @items, $i;          #               Grep::Event::Result->new( $i )->publish;
116    
117  #               Grep::Event::Result->new( $i )->publish;                          Jifty->log->debug("published ", $i->id ) ; # dump( $entry, $i ) );
118                    } else {
119                            warn "can't create item from entry ", dump( $entry ) unless ( $i->id );
120                    }
121    
                 Jifty->log->debug("published ", $i->id ) ; # dump( $entry, $i ) );  
122          }          }
123    
124          if ( @items ) {          if ( @items ) {

Legend:
Removed from v.24  
changed lines
  Added in v.25

  ViewVC Help
Powered by ViewVC 1.1.26