Changeset 3
- Timestamp:
- 10/01/06 04:28:37
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plagger/trunk/my-plugins/CustomFeed-FileList/FileList.pm
r2 r3 3 3 use base qw( Plagger::Plugin ); 4 4 5 use Encode;6 5 use Plagger::UserAgent; 7 use Plagger::Util qw( decode_content extract_title);6 use Plagger::Util qw( decode_content ); 8 7 use Plagger::Date; 8 use Digest::MD5 qw(md5_hex); 9 9 10 10 … … 44 44 45 45 46 # input resutl of 'ls -laRT' 46 47 my @files = split /\n/, $content; 47 48 @files = map {s!/$!!; $_} … … 50 51 for my $file (@files) { 51 52 my @infos = split /\s+/, $file; 53 next if ($self->conf->{dir_only} && $infos[0] =~ m!^d!); 54 52 55 my $title = $infos[9]; 53 56 my $author = $infos[2]; … … 55 58 56 59 my $entry = Plagger::Entry->new; 57 $entry->title($ infos[9]);60 $entry->title($title); 58 61 59 $entry->author($ infos[2]);62 $entry->author($author); 60 63 $entry->date(Plagger::Date->strptime('%m %d %T %Y', $date)); 61 $entry->id( $file);64 $entry->id(md5_hex($file)); 62 65 63 66 $feed->add_entry($entry);
