Parent Directory | Revision Log | Patch
revision 315 by dpavlin, Wed Nov 5 21:12:31 2008 UTC | revision 323 by dpavlin, Thu Nov 6 17:58:20 2008 UTC | |
---|---|---|
# | Line 1 | Line 1 |
1 | package Frey::DelIcioUs; | package Frey::DelIcioUs; |
2 | use Moose; | use Moose; |
3 | ||
with 'Frey::Config'; | ||
4 | with 'Frey::Storage'; | with 'Frey::Storage'; |
5 | ||
6 | use LWP::UserAgent; | |
7 | use XML::Simple; | |
8 | use Data::Dump qw/dump/; | |
9 | ||
10 | has 'username' => ( | has 'username' => ( |
11 | is => 'rw', | is => 'rw', |
12 | isa => 'Str', | isa => 'Str', |
13 | required => 1, | required => 1, |
default => sub { | ||
my $self = shift; | ||
$self->config->{username}; | ||
}, | ||
14 | ); | ); |
15 | ||
16 | has 'password' => ( | has 'password' => ( |
17 | is => 'rw', | is => 'ro', |
18 | isa => 'Str', | isa => 'Str', |
19 | required => 1, | required => 1, |
default => sub { | ||
my $self = shift; | ||
$self->config->{password}; | ||
}, | ||
20 | ); | ); |
21 | ||
22 | has 'path' => ( | has 'path' => ( |
# | Line 33 has 'path' => ( | Line 28 has 'path' => ( |
28 | } | } |
29 | ); | ); |
30 | ||
use LWP::UserAgent; | ||
use XML::Simple; | ||
use Data::Dump qw/dump/; | ||
31 | sub data { | sub data { |
32 | my $self = shift; | my $self = shift; |
33 | ||
# | Line 55 sub data { | Line 46 sub data { |
46 | warn substr($content,0,100), ' ... ', substr($content,-100); | warn substr($content,0,100), ' ... ', substr($content,-100); |
47 | my $posts = XMLin( $content ); | my $posts = XMLin( $content ); |
48 | warn dump( $posts ); | warn dump( $posts ); |
49 | $self->store( $self->path, $posts ); | $self->store( $self->path . '.yml', $posts ); |
50 | return $posts; | return $posts; |
51 | } | } |
52 |
|
ViewVC Help | |
Powered by ViewVC 1.1.26 |