/[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

revision 333 by dpavlin, Sat Nov 8 16:59:08 2008 UTC revision 352 by dpavlin, Sun Nov 16 13:11:27 2008 UTC
# Line 21  has 'password' => ( Line 21  has 'password' => (
21    
22  sub path {  sub path {
23          my $self = shift;          my $self = shift;
24          'var/delicious/' . $self->username;          'var/delicious/' . $self->username . '.yml';
25  }  }
26    
27  sub data {  sub posts {
28          my $self = shift;          my $self = shift;
29    
30          if ( my $posts = $self->load( $self->path ) ) {          if ( my $posts = $self->load( $self->path ) ) {
# Line 42  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 . '.yml', $posts );          $self->store( $self->path, $posts );
46          return $posts;          return $posts;
47  }  }
48    
49    sub data {
50            my $self = shift;
51            $self->posts;
52    }
53    
54    sub sponge {
55            my $self = shift;
56    
57            my $posts = $self->posts->{post};
58            die "not ARRAY ",dump( $posts ) unless ref($posts) eq 'ARRAY';
59    
60            my @NAME = keys %{ $posts->[0] };
61            my @rows;
62    
63            foreach my $post ( @$posts ) {
64                    my @row;
65                    push @row, $post->{ $_ } foreach @NAME;
66                    push @rows, \@row;
67            }
68    
69    
70            return {
71                    rows => \@rows,
72                    NAME => \@NAME,
73            }
74    }
75    
76  1;  1;

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

  ViewVC Help
Powered by ViewVC 1.1.26