| 1 | use strict; | ||
| 2 | use warnings; | ||
| 3 | |||
| 4 | package Net::Google::PicasaWeb::Album; | ||
| 5 | use Moose; | ||
| 6 | |||
| 7 | extends 'Net::Google::PicasaWeb::MediaFeed'; | ||
| 8 | |||
| 9 | use Net::Google::PicasaWeb::Media; | ||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | Net::Google::PicasaWeb::Album - represents a single Picasa Web photo album | ||
| 14 | |||
| 15 | =head1 SYNOPSIS | ||
| 16 | |||
| 17 | my @albums = $service->list_albums; | ||
| 18 | for my $album (@albums) { | ||
| 19 | print "Title: ", $album->title, "\n"; | ||
| 20 | print "Summary: ", $album->summary, "\n"; | ||
| 21 | print "Author: ", $album->author_name, " (", $album->author_uri, ")\n"; | ||
| 22 | |||
| 23 | $album->fetch_content( file => 'cover-photo.jpg' ); | ||
| 24 | } | ||
| 25 | |||
| 26 | =head1 DESCRIPTION | ||
| 27 | |||
| 28 | Represents an individual Picasa Web photo album. | ||
| 29 | |||
| 30 | =head1 ATTRIBUTES | ||
| 31 | |||
| 32 | =head2 title | ||
| 33 | |||
| 34 | This is the title of the album. | ||
| 35 | |||
| 36 | =head2 summary | ||
| 37 | |||
| 38 | This is the summary of the album. | ||
| 39 | |||
| 40 | =head2 author_name | ||
| 41 | |||
| 42 | This is the author/owner of the album. | ||
| 43 | |||
| 44 | =head2 author_uri | ||
| 45 | |||
| 46 | This is the URL to get to the author's public albums on Picasa Web. | ||
| 47 | |||
| 48 | =head2 photo | ||
| 49 | |||
| 50 | This is a link to the L<Net::Google::PicasaWeb::Media> object that is used to reference the cover photo and thumbnails of it. | ||
| 51 | |||
| 52 | =head1 METHODS | ||
| 53 | |||
| 54 | =head2 list_media_entries | ||
| 55 | |||
| 56 | =head2 list_photos | ||
| 57 | |||
| 58 | =head2 list_videos | ||
| 59 | |||
| 60 | my @photos = $album->list_media_entries(%params); | ||
| 61 | |||
| 62 | Lists photos and video entries in the album. Options may be used to modify the photos returned. | ||
| 63 | |||
| 64 | This method takes the L<Net::Google::PicasaWeb/STANDARD LIST OPTIONS>. | ||
| 65 | |||
| 66 | The L</list_photos> and L</list_videos> methods are synonyms for L</list_media_entries>. | ||
| 67 | |||
| 68 | =cut | ||
| 69 | |||
| 70 | sub list_media_entries { | ||
| 71 | my ($self, %params) = @_; | ||
| 72 | $params{kind} = 'photo'; | ||
| 73 | |||
| 74 | return $self->service->list_entries( | ||
| 75 | 'Net::Google::PicasaWeb::MediaEntry', | ||
| 76 | $self->url, | ||
| 77 | %params, | ||
| 78 | ); | ||
| 79 | } | ||
| 80 | |||
| 81 | *list_photos = *list_media_entries; | ||
| 82 | *list_videos = *list_media_entries; | ||
| 83 | |||
| 84 | =head2 list_tags | ||
| 85 | |||
| 86 | Lists tags used in the albums. | ||
| 87 | |||
| 88 | This method takes the L<Net::Google::PicasaWeb/STANDARD LIST OPTIONS>. | ||
| 89 | |||
| 90 | =cut | ||
| 91 | |||
| 92 | sub list_tags { | ||
| 93 | my ($self, %params) = @_; | ||
| 94 | $params{kind} = 'tag'; | ||
| 95 | |||
| 96 | my $user_id = delete $params{user_id} || 'default'; | ||
| 97 | return $self->service->list_entries( | ||
| 98 | 'Net::Google::PicasaWeb::Tag', | ||
| 99 | $self->url, | ||
| 100 | %params | ||
| 101 | ); | ||
| 102 | } | ||
| 103 | |||
| 104 | =head1 AUTHOR | ||
| 105 | |||
| 106 | Andrew Sterling Hanenkamp, C<< <hanenkamp at cpan.org> >> | ||
| 107 | |||
| 108 | =head1 COPYRIGHT & LICENSE | ||
| 109 | |||
| 110 | Copyright 2008 Andrew Sterling Hanenkamp. | ||
| 111 | |||
| 112 | This program is free software; you can redistribute it and/or modify it | ||
| 113 | under the same terms as Perl itself. | ||
| 114 | |||
| 115 | =cut | ||
| 116 | |||
| 117 | 1; |