Changeset 10
- Timestamp:
- 02/04/06 18:58:13
- Files:
-
- trunk/plagger (modified) (1 prop)
- trunk/plagger/lib/Plagger/Plugin/Widget/Delicious.pm (modified) (2 diffs)
- trunk/plagger/lib/Plagger/Plugin/Widget/HatenaBookmark.pm (added)
- trunk/plagger/templates/plugins/gmail_notify.tt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger
- Property svn:ignore set to config.yaml
trunk/plagger/lib/Plagger/Plugin/Widget/Delicious.pm
r3 r10 2 2 use strict; 3 3 use base qw( Plagger::Plugin ); 4 5 use Encode; 6 use HTML::Entities; 7 use URI; 4 8 5 9 sub register { … … 13 17 sub add { 14 18 my($self, $context, $entry, $content) = @_; 15 my $widget = Plagger::Widget::Delicious->new( 16 username => $self->conf->{username}, 17 entry => $entry, 18 ); 19 $entry->add_widget($widget); 20 } 21 22 package Plagger::Widget::Delicious; 23 24 use Encode; 25 use HTML::Entities; 26 use URI; 27 28 sub new { 29 my($class, %opt) = @_; 30 bless \%opt, $class; 19 $entry->add_widget($self); 31 20 } 32 21 33 22 sub html { 34 my $self = shift;35 my $uri = URI->new('http://del.icio.us/' . $self-> {username});23 my($self, $entry) = @_; 24 my $uri = URI->new('http://del.icio.us/' . $self->conf->{username}); 36 25 $uri->query_form( 37 26 v => 3, 38 url => $ self->{entry}->link,39 title => encode('utf-8', $ self->{entry}->title),27 url => $entry->link, 28 title => encode('utf-8', $entry->title), 40 29 ); 41 30 trunk/plagger/templates/plugins/gmail_notify.tt
r7 r10 9 9 [% IF item.body.match('(?i)^<p[ >]') %][% item.body %][% ELSE %]<div style="padding: 1em 0">[% item.body %]</div>[% END %] 10 10 [% ELSE %]<br />[% END %] 11 <div style="font-size:0.8em">[% IF item.date %]Posted on [% item.date.format('Mail') %][% END %] | <a href="[% link | html %]">permalink</a> | <a href="[% feed.link | html %]">[% feed.title | html %]</a>[% FOREACH widget = item.widgets %] | [% widget.html %][% END %]<br clear="all" /></div>11 <div style="font-size:0.8em">[% IF item.date %]Posted on [% item.date.format('Mail') %][% END %] | <a href="[% link | html %]">permalink</a> | <a href="[% feed.link | html %]">[% feed.title | html %]</a>[% FOREACH widget = item.widgets %] | [% widget.html(item) %][% END %]<br clear="all" /></div> 12 12 </div>
