Net::Google::PicasaWeb::Media - hold information about a photo or video
my @photos = $album->list_media_entries; for my $photo (@photos) { my $media_info = $photo->photo; print "Image Title: ", $media_info->title, "\n"; print "Image Description: ", $media_info->description, "\n\n"; my $main_photo = $media_info->content; print "Image URL: ", $main_photo->url, "\n"; print "Image MIME Type: ", $main_photo->mime_type, "\n"; print "Image Medium: ", $main_photo->medium, "\n"; print "Thumbnails:\n\n"; for my $thumbnail ($media_info->thumbnails) { print " Thumbnail URL: ", $thumbnail->url, "\n"; print " Thumbnail Dimensions: ", $thumbnail->width, "x", $thumbnail->height, "\n\n"; my $photo_data = $thumbnail->fetch; $thumbnail->fetch( file => 'thumbnail.jpg' ); } my $photo_data = $main_photo->fetch; $main_photo->fetch( file => 'photo.jpg' ); }
This is where you will find information about the photos, videos, and thumbnails themselves. You can get information about them with this object, such as the URL that can be used to download the media file. This object (and its children) also provide some features to fetching this information.
This is the title of the photo or video.
This is a description for the photo or video.
This is the main photo or video item attached to the media information entry. See "MEDIA CONTENT" below for information about the object returned.
This is an array of object containing information about the thumbnails that were attached when the photo was retrieved from the server. See "THUMBNAILS" below for information about these objects.
Builds a media class from a service object and reference to a <media:group> object in XML::Twig::Elt.
<media:group>
The object returned from the "content" accessor is an object with the following accessors and methods.
This is the parent Net::Google::PicasaWeb::Media object.
This is the URL where the photo or video may be downloaded from.
This is the MIME-Type of the photo or video.
This should be one of the following scalar values describing the media entry:
image
video
my $data = $content->fetch(%params);
Fetches the image or video from Picasa Web. By default, this method returns the file data as a scalar.
This method accepts the following parameters, which modify this behavior:
If given, the data will not be returned, but saved to the named file instead.
Each thumbnail returned represents an individual image resource used as a thumbnail for the main item. Each one has the following attributes and methods.
This is the URL where the thumbnail image can be pulled down from.
This is the pixel width of the image.
This is the pixel height of the image.
my $data = $thumbnail->fetch(%params);
Fetches the thumbnail image from Picasa Web. By default, this method returns the image data as a scalar.
Andrew Sterling Hanenkamp, <hanenkamp at cpan.org>
<hanenkamp at cpan.org>
Copyright 2008 Andrew Sterling Hanenkamp
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::Google::PicasaWeb, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Google::PicasaWeb
CPAN shell
perl -MCPAN -e shell install Net::Google::PicasaWeb
For more information on module installation, please visit the detailed CPAN module installation guide.