| Net-Delicious documentation | Contained in the Net-Delicious distribution. |
Net::Delicious::Post - OOP for del.icio.us post thingies
use Net::Delicious;
my $del = Net::Delicious->new({...});
foreach my $post ($del->recent_posts()) {
# $post is a Net::Delicious::Post
# object.
print "$post\n";
}
OOP for del.icio.us post thingies.
Returns a Net::Delicious::Post object. Woot!
Returns a string.
Returns a string.
Returns a string.
Returns a string.
Returns a Net::Delicious::User object.
Returns a string, formatted YYYY-MM-DD
Return the object as a hash ref safe for serializing and re-blessing.
1.13
$Date: 2008/03/03 16:55:04 $
Aaron Straup Cope <ascope@cpan.org>
Copyright (c) 2004-2008 Aaron Straup Cope. All rights reserved.
This is free software, you may use it and distribute it under the same terms as Perl itself.
| Net-Delicious documentation | Contained in the Net-Delicious distribution. |
# $Id: Post.pm,v 1.25 2008/03/03 16:55:04 asc Exp $ use strict; package Net::Delicious::Post; use base qw (Net::Delicious::Object); $Net::Delicious::Post::VERSION = '1.14';
use Net::Delicious::User; use overload q("") => sub { shift->href() };
sub new { my $pkg = shift; my $args = shift; my $self = $pkg->SUPER::new($args); # this one seems to be the source of some # confusion - unclear whether it's me or # inconsistency in the API itself $self->{tags} ||= $args->{ tag }; $self->{user} = Net::Delicious::User->new({name => $args->{user}}); return $self; }
# Defined in Net::Delicious::Object
# Defined in Net::Delicious::Object
# Defined in Net::Delicious::Object sub url { return shift->href(); } sub link { return shift->href(); }
# Defined in Net::Delicious::Object
sub tags { return shift->tag(); }
sub user { return shift->{user}; }
# Defined in Net::Delicious::Object
sub shared { my $self = shift; my $raw = shift; if ($raw) { return $self->{shared}; } return ($self->{shared} eq "no") ? 0 : 1; }
sub as_hashref { my $self = shift; my $data = $self->SUPER::as_hashref(); $data->{user} = $self->user()->name(); return $data; }
return 1;