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 |
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 |
|
|
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 ) { |