Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor tweaks to Publish::Delicious and Filter::RSSLiberalDateTime #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Plagger/Plugin/Filter/RSSLiberalDateTime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ sub fixup_datetime {
my @time = Date::Parse::strptime($date) or return $date;

my $dt = DateTime->new(
second => $time[0],
minute => $time[1],
hour => $time[2],
second => $time[0] || 0,
minute => $time[1] || 0,
hour => $time[2] || 0,
day => $time[3],
month => $time[4] + 1,
year => $time[5] + 1900,
Expand Down
9 changes: 8 additions & 1 deletion lib/Plagger/Plugin/Publish/Delicious.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ sub add_entry {

my @tags = @{$args->{entry}->tags};
my $tag_string = @tags ? join(' ', @tags) : '';
$tag_string .= ' ' . $self->conf->{tags} if $self->conf->{tags};

my $params = {
url => $args->{entry}->link,
Expand All @@ -40,7 +41,8 @@ sub add_entry {
$params->{extended} = encode('utf-8', $args->{entry}->body_text),
}

$self->{delicious}->add_post($params);
$self->{delicious}->add_post($params)
or die $context->log(error => "Posting to delicious failed");

my $sleeping_time = $self->conf->{interval} || 3;
$context->log(info => "Post entry success. sleep $sleeping_time.");
Expand All @@ -63,6 +65,7 @@ Plagger::Plugin::Publish::Delicious - Post to del.icio.us automatically
password: your-password
interval: 2
post_body: 1
tags: tag1 tag2

=head1 DESCRIPTION

Expand All @@ -84,6 +87,10 @@ Interval (as seconds) to sleep after posting each bookmark. Defaults to 3.

A flag to post entry's body as extended field for del.icio.us. Defaults to 0.

=item tags

A space-separated list of tags to be added to those found in the feed entry.

=back

=cut
Expand Down