Changeset 1970
- Timestamp:
- 10/09/07 21:48:39
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/deps/CustomFeed-MixiScraper.yaml
r1961 r1970 2 2 author: Kenichi Ishigaki 3 3 depends: 4 WWW::Mixi::Scraper: 0.0 74 WWW::Mixi::Scraper: 0.09 trunk/plagger/lib/Plagger/Plugin/CustomFeed/MixiScraper.pm
r1961 r1970 40 40 get_list => 'show_calendar', 41 41 get_detail => 'view_event', 42 }, 43 BBS => { 44 title => 'コミュニティ最新書き込み', 45 get_list => 'new_bbs', 46 get_detail => 'view_bbs', 42 47 }, 43 48 }; … … 137 142 } 138 143 144 my @comments; 139 145 if ($self->conf->{fetch_body} && !$blocked && $msg->{link} =~ /view_/ && defined $MAP->{$type}->{get_detail}) { 146 # view_enquete is not implemented and probably 147 # won't be implemented as it seems redirected to 148 # reply_enquete 149 next if $msg->{link} =~ /view_enquete/; 140 150 $context->log(info => "Fetch body from $msg->{link}"); 141 151 my $item = $self->cache->get_callback( 142 "item- $msg->{link}",152 "item-".$msg->{link}, 143 153 sub { 144 154 Time::HiRes::sleep( $self->conf->{fetch_body_interval} || 1.5 ); … … 162 172 163 173 $entry->date( Plagger::Date->parse($format, $item->{time}) ); 174 if ($self->conf->{fetch_comment}) { 175 for my $comment (@{ $item->{comments} || [] }) { 176 my $c = Plagger::Entry->new; 177 $c->title($entry->title . ': '. $comment->{subject}); 178 $c->body($comment->{description}); 179 $c->link($comment->{link}); 180 $c->author($comment->{name}); 181 $c->date( Plagger::Date->parse($format, $comment->{time}) ); 182 push @comments, $c; 183 } 184 } 164 185 } else { 165 186 $context->log(warn => "Fetch body failed. You might be blocked?"); … … 169 190 170 191 $feed->add_entry($entry); 192 for my $comment ( @comments ) { 193 $feed->add_entry($comment); 194 } 171 195 } 172 196 … … 189 213 password: password 190 214 fetch_body: 1 215 fetch_comment: 0 191 216 show_icon: 1 192 217 feed_type: … … 223 248 link to the entry. Defaults to 0. 224 249 250 =item fetch_comment 251 252 With this option set, this plugin fetches entry's comments as well 253 (meaningless when C<fetch_body> is not set). Defaults to 0. 254 225 255 =item fetch_body_interval 226 256
