Changeset 365
- Timestamp:
- 03/07/06 22:30:55
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Plugin/CustomFeed/iTunesRecentPlay.pm
r360 r365 7 7 use DateTime::Format::W3CDTF; 8 8 use HTML::Entities; 9 use LWP::Simple; 9 10 10 11 sub register { … … 71 72 next; 72 73 } 73 for my $key (keys %$data){ 74 $entry->meta->{$key} = $data->{$key}; 74 if( !defined $self->conf->{duration} or $dt->epoch > time - $self->conf->{duration} * 60 ){ 75 for my $key (keys %$data){ 76 $entry->meta->{$key} = $data->{$key}; 77 } 78 $entry->date(Plagger::Date->from_epoch($dt->epoch)); 79 $context->log( debug => $data->{artist} . ' ' . $data->{track}); 80 $feed->add_entry($entry); 75 81 } 76 $entry->date(Plagger::Date->from_epoch($dt->epoch));77 $context->log( debug => $data->{artist} . ' ' . $data->{track});78 $feed->add_entry($entry);79 82 } 80 83 $data = {}; … … 94 97 =head1 SYNOPSIS 95 98 99 # entries updated within 120 minutes 96 100 - module: CustomFeed::iTunesRecentPlay 97 101 config: 98 102 library_path: /path/to/iTunes Music Library.xml 99 reload_period: 3600103 duration: 120 100 104 101 105 =head1 DESCRIPTION … … 112 116 this plugin try to find it automatically. 113 117 114 =item reload_period118 =item duration 115 119 116 120 This plugin find a music played recently if last played time is within 117 this parameter.It's good to define this parameter same as execution 118 period of plagger with cron .121 this parameter.It's good to define this parameter same as execution 122 period of plagger with cron to reduce memory usage. 119 123 120 124 =back
