WebService::GData::YouTube::Feed::PlaylistLink - playlists meta data (read/write) for data API v2.
use WebService::GData::YouTube; use constant KEY=>'...'; my $auth; eval { $auth = new WebService::GData::ClientLogin( email=>'...', password=>'...', key=>KEY ); }; die $@->code,$@->content if $@; my $yt = new WebService::GData::YouTube($auth); #get logged in user playlists my $playlists; eval { $playlists = $yt->get_user_playlists; }; die $@->code,$@->content if $@; #and list them: foreach my $playlist (@$playlists){ print $playlist->title; print $playlist->summary; print $playlist->keywords; print $playlist->is_private; print $playlist->playlist_id; } #erase a specific playlist my $playlist = $yt->playlists; $playlist->playlist_id(q[9ED74863...A2B8]); $playlist->delete; #create a playlist my $playlist = $yt->playlists; #set information about the playlist $playlist->title('testing something'); $playlist->summary('new summary'); $playlist->keywords("keyword1,keyword2"); $playlist->is_private(1); eval { $playlist->save; }; die $@->code,$@->content if $@;
!DEVELOPER RELEASE! API may change, program may break or be under optimized.
!WARNING! Documentation in progress.
inherits from WebService::GData::Feed::Entry.
This package represents a PlaylistLink which contains the meta information about playlists (title,description,keywords,etc).
If you are logged in you can edit/erase existing playlist metadata,create a new playlist.
Most of the time you will not instantiate this class directly but use the helper in the WebService::GData::YouTube class.
Create a WebService::GData::YouTube::Feed::PlaylistLink instance.
Parameters:
jsonc_playlists_entry_feed:Object
authorization:Object
or
If an authorization object is set (WebService::GData::ClientLogin),
it will allow you to access private contents and insert/edit/delete playlists.
All the following read only methods give access to the information contained in a playlist feed.
All these methods represents the meta data of a playlist but you have read/write access on them.
It is therefore necessary to be logged in programmaticly to be able to use them in write mode (if not, saving the data will not work).
This will be the name of your playlist.
This will be the explanation of the kind of content contained in this playlist.
Keywords representing the playlists.
Only specific person can access this playlist if set to private.
The unique id of this playlist (usually required for edit/erase)
These methods actually query the service to save your edits.
You must be logged in programmaticly to be able to use them.
You must specify the playlist to erase by setting its unique id via playlist_id.
The save method will do an insert if there is no playlist_id or an update if there is one.
Append an existing video into a playlist(query the API to insert the data, you must be logged in programmatically).
Parameters
video_id:Scalar
Returns
Throws
Example:
my $yt = new WebService::GData::YouTube($auth); my $playlist = $yt->playlists; $playlist->playlist_id("playlist_id"); $playlist->add_video("video_id"); #or my $yt = new WebService::GData::YouTube($auth); my $playlist = $yt->get_user_playlists()->[0];//example:the first playlist in the list $playlist->add_video("video_id");
If you do me the favor to _use_ this module and find a bug, please email me i will try to do my best to fix it (patches welcome)!
shiriru <shirirulestheworld[arobas]gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WebService::GData, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::GData
CPAN shell
perl -MCPAN -e shell install WebService::GData
For more information on module installation, please visit the detailed CPAN module installation guide.