line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Lazyd; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
42
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
537
|
use Net::Delicious; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use URI::Title qw( title ); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub run { |
12
|
|
|
|
|
|
|
my (undef, $config, $url, @tags) = @_; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
die "Need to set both username and password." |
15
|
|
|
|
|
|
|
unless defined($config->{username}) && defined($config->{password}); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
die "You should give me an URL, dude.\n" |
18
|
|
|
|
|
|
|
unless defined $url; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $del = Net::Delicious->new({ |
21
|
|
|
|
|
|
|
user => $config->{username}, |
22
|
|
|
|
|
|
|
pswd => $config->{password} |
23
|
|
|
|
|
|
|
}); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $title = title($url) || ""; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$del->add_post({ |
28
|
|
|
|
|
|
|
url => $url, |
29
|
|
|
|
|
|
|
tags => join(" ", @tags, split(/\W/, "$url $title")), |
30
|
|
|
|
|
|
|
description => $url, |
31
|
|
|
|
|
|
|
}); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
__END__ |