Net::Google::PicasaWeb::Album - represents a single Picasa Web photo album


Net-Google-PicasaWeb documentation Contained in the Net-Google-PicasaWeb distribution.

Index


Code Index:

NAME

Top

Net::Google::PicasaWeb::Album - represents a single Picasa Web photo album

VERSION

Top

version 0.11

SYNOPSIS

Top

  my @albums = $service->list_albums;
  for my $album (@albums) {
      print "Title: ", $album->title, "\n";
      print "Summary: ", $album->summary, "\n";
      print "Author: ", $album->author_name, " (", $album->author_uri, ")\n";

      $album->fetch_content( file => 'cover-photo.jpg' );
  }

DESCRIPTION

Top

Represents an individual Picasa Web photo album. This class extends Net::Google::PicasaWeb::Feed.

ATTRIBUTES

Top

url

The URL used to get the album information. See url in Net::Google::PicasaWeb::Feed.

title

This is the title of the album. See title in Net::Google::PicasaWeb::Feed.

summary

This is the summary of the album. See summary in Net::Google::PicasaWeb::Feed.

author_name

This is the author/owner of the album. See author_name in Net::Google::PicasaWeb::Feed.

author_uri

This is the URL to get to the author's public albums on Picasa Web. See author_uri in Net::Google::PicasaWeb::Feed.

entry_id

This is the identifier of the album used to look up a specific album in the API. This is the album ID. See entry_id in Net::Google::PicasaWeb::Feed.

latitude

The goe-coded latitude set on the album. See latitude in Net::Google::PicasaWeb::Feed.

longitude

The geo-coded longitude set on the album. See longitude in Net::Google::PicasaWeb::Feed.

photo

This is a link to the Net::Google::PicasaWeb::Media object that is used to reference the cover photo and thumbnails of it.

bytes_used

This is the size of the album in bytes.

number_of_photos

This is the number of photos in the albums.

METHODS

Top

list_media_entries

list_photos

list_videos

  my @photos = $album->list_media_entries(%params);

Lists photos and video entries in the album. Options may be used to modify the photos returned.

This method takes the STANDARD LIST OPTIONS in Net::Google::PicasaWeb.

The list_photos and list_videos methods are synonyms for list_media_entries.

list_tags

Lists tags used in the albums.

This method takes the STANDARD LIST OPTIONS in Net::Google::PicasaWeb.

AUTHOR

Top

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE

Top


Net-Google-PicasaWeb documentation Contained in the Net-Google-PicasaWeb distribution.

package Net::Google::PicasaWeb::Album;
BEGIN {
  $Net::Google::PicasaWeb::Album::VERSION = '0.11';
}
use Moose;

# ABSTRACT: represents a single Picasa Web photo album

extends 'Net::Google::PicasaWeb::MediaFeed';

use Net::Google::PicasaWeb::Media;


has bytes_used => (
    is          => 'rw',
    isa         => 'Int',
    predicate   => 'has_bytes_used',
);


has number_of_photos => (
    is          => 'rw',
    isa         => 'Int',
    predicate   => 'has_number_of_photos',
);


override from_feed => sub {
    my ($class, $service, $entry) = @_;
    my $self = $class->super($service, $entry);

    $self->bytes_used($entry->field('gphoto:bytesUsed'))
        if $entry->field('gphoto:bytesUsed');
    $self->number_of_photos($entry->field('gphoto:numphotos'))
        if $entry->field('gphoto:numphotos');;

    return $self;
};


sub list_media_entries {
    my ($self, %params) = @_;
    $params{kind} = 'photo';

    return $self->service->list_entries(
        'Net::Google::PicasaWeb::MediaEntry',
        $self->url,
        %params,
    );
}

sub list_photos { shift->list_media_entries(@_) }
sub list_videos { shift->list_media_entries(@_) }


sub list_tags {
    my ($self, %params) = @_;
    $params{kind} = 'tag';

    my $user_id = delete $params{user_id} || 'default';
    return $self->service->list_entries(
        'Net::Google::PicasaWeb::Tag',
        $self->url,
        %params
    );
}

__PACKAGE__->meta->make_immutable;

1;

__END__