root/trunk/plagger/lib/Plagger/Plugin/Filter/DeliciousFeedTags.pm

Revision 183 (checked in by miyagawa, 15 years ago)

oops, remove the debug bit

  • Property svn:keywords set to Id Revision
Line 
1 package Plagger::Plugin::Filter::DeliciousFeedTags;
2 use strict;
3 use base qw( Plagger::Plugin );
4
5 use Plagger::Tag;
6
7 sub register {
8     my($self, $context) = @_;
9     $context->register_hook(
10         $self,
11         'update.entry.fixup' => \&filter,
12     );
13 }
14
15 sub filter {
16     my($self, $context, $args) = @_;
17
18     return unless $args->{feed}->url =~ m!^http://del\.icio\.us/rss/!;
19
20     $context->log(debug => "Fixing del.icio.us tags " . $args->{entry}->tags->[0]);
21
22     my @tags = Plagger::Tag->parse($args->{entry}->tags->[0]);
23     $args->{entry}->tags(\@tags);
24 }
25
26 1;
27
28 __END__
29
30 =head1 NAME
31
32 Plagger::Plugin::Filter::DeliciousFeedTags - Fix del.icio.us tags
33
34 =head1 SYNOPSIS
35
36   - module: Filter::DeliciousFeedTags
37
38 =head1 DESCRIPTION
39
40 del.icio.us RSS feeds contain information to "tags", but they're
41 encoded in a single I<dc:subject> element as whiltespace-delimitered,
42 like C<foo bar baz>.
43
44 This plugin walks through feeds matching with
45 I<http://del.icio.us/rss/*> and fixes the tags information by
46 splitting them out.
47
48 =head1 AUTHOR
49
50 Tatsuhiko Miyagawa
51
52 =head1 SEE ALSO
53
54 L<Plagger>, L<http://del.icio.us/>
55
56 =cut
Note: See TracBrowser for help on using the browser.