NAME

WebService::GData::YouTube::Feed::PlaylistLink - playlists meta data (read/write) for data API v2.

SYNOPSIS

   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 $@;   

    

DESCRIPTION

!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.

CONSTRUCTOR

new

Parameters:

jsonc_playlists_entry_feed:Object (Optional)
authorization:Object (Optional)

or

authorization:Object (Optional)

If an authorization object is set (WebService::GData::ClientLogin),

it will allow you to access private contents and insert/edit/delete playlists.

GET METHODS

All the following read only methods give access to the information contained in a playlist feed.

count_hint

GENERAL SET/GET METHODS

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).

title

This will be the name of your playlist.

summary

This will be the explanation of the kind of content contained in this playlist.

keywords

Keywords representing the playlists.

is_private

Only specific person can access this playlist if set to private.

playlist_id

The unique id of this playlist (usually required for edit/erase)

QUERY METHODS

These methods actually query the service to save your edits.

You must be logged in programmaticly to be able to use them.

delete

You must specify the playlist to erase by setting its unique id via playlist_id.

save

The save method will do an insert if there is no playlist_id or an update if there is one.

add_video

    Append an existing video into a playlist(query the API to insert the data, you must be logged in programmatically).

    Parameters

    video_id:Scalar - the video id to add

    Returns

    void

    Throws

    WebService::GData::Error in case of an error

    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"); 
     

BUGS AND LIMITATIONS

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)!

AUTHOR

shiriru <shirirulestheworld[arobas]gmail.com>

LICENSE AND COPYRIGHT

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.