/[Frey]/trunk/lib/Frey/DelIcioUs.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/DelIcioUs.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/lib/Data/DelIcioUs.pm revision 226 by dpavlin, Sat Nov 1 01:03:40 2008 UTC trunk/lib/Frey/DelIcioUs.pm revision 333 by dpavlin, Sat Nov 8 16:59:08 2008 UTC
# Line 1  Line 1 
1  package Data::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' => (
         is => 'rw',  
         isa => 'Str',  
         required => 1,  
         default => sub {  
                 my $self = shift;  
                 $self->config->{password};  
         },  
 );  
   
 has 'path' => (  
17          is => 'ro',          is => 'ro',
18          isa => 'Str',          isa => 'Str',
19          default => sub {          required => 1,
                 my $self = shift;  
                 'var/delicious/' . $self->username;  
         }  
20  );  );
21    
22  use LWP::UserAgent;  sub path {
23  use XML::Simple;          my $self = shift;
24  use Data::Dump qw/dump/;          'var/delicious/' . $self->username;
25    }
26    
27  sub data {  sub data {
28          my $self = shift;          my $self = shift;
# Line 55  sub data { Line 42  sub data {
42          warn substr($content,0,100), ' ... ', substr($content,-100);          warn substr($content,0,100), ' ... ', substr($content,-100);
43          my $posts = XMLin( $content );          my $posts = XMLin( $content );
44          warn dump( $posts );          warn dump( $posts );
45          $self->store( $self->path, $posts );          $self->store( $self->path . '.yml', $posts );
46          return $posts;          return $posts;
47  }  }
48    

Legend:
Removed from v.226  
changed lines
  Added in v.333

  ViewVC Help
Powered by ViewVC 1.1.26