GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
WebService::GData::YouTube::Feed::PlaylistLink(3) User Contributed Perl Documentation WebService::GData::YouTube::Feed::PlaylistLink(3)

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.

new

Create a WebService::GData::YouTube::Feed::PlaylistLink instance.

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.

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

count_hint

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)

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

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.
2011-11-13 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.