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::VideoMessage(3) User Contributed Perl Documentation WebService::GData::YouTube::Feed::VideoMessage(3)

WebService::GData::YouTube::Feed::VideoMessage - a video message (read/write) for data API v2.

    #list the video messages sent
    #you must be logged in

    use WebService::GData::YouTube;
    use WebService::GData::ClientLogin;
    
    my $auth;

    eval {
        $auth = new WebService::GData::ClientLogin(
            email    => '...',
            password => '...',
            key      => '...'
        );
    };
    if(my $error = $@){
        #$error->code,$error->content...
    }
    
    my $yt = new WebService::GData::YouTube($auth);
     
    my $messages = $yt->get_user_inbox();   
    foreach my $message (@$messages) {
        say $message->subject;  
        say $message->summary;
        say $message->sent;
        say $message->from->name;
        say $message->title;     #video title
        if($message->subject()=~m/SPAM/){
            $message->delete();
        }
    }
    
    #send a video message

    my $message = $yt->message;
    $message->summary('look at that!');
    $message->id('video_id_goes_here');
    $message->send('channel_name');

!WARNING! Documentation in progress.

!DEVELOPER RELEASE! API may change, program may break or be under optimized and I haven't done a full range of tests yet!

inherits from WebService::GData::YouTube::Feed::Video.

This package represents a Youtube Video message than can be sent by your friends only. Most of the time, you will retrieve a list of messages and from there you should be able to apply a delete.

You can not access other kind of messages.

Most of the time you will not instantiate this class directly but use the message method in the WebService::GData::YouTube class.

new

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

Parameters:

"jsonc_video_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 insert new messages.

This class inherits from the Video class.

Therefore all the video methods can be used to retrieve information about the video shared such as the ->title method.

The following method wraps existing video methods used in the context of a video message.

subject

This returns the title tag which, in this context, is equal to the automaticly created mail title. It contains the author name and the shared video title.

You can not set the title when sending a message, only the content of the message.

from

This returns the Author of the message.

sent

This returns the published tag which, in this context, is equal to the date the mail was sent.

summary

This is the message itself. The package does not encode,clean the data. YouTube replaces HTML with html entities.

video_id

The video id you which to share.

This method actually query the service to save your data. You must be logged in programmaticly to be able to use them.

save / send

The save method will do an insert only if a video_id is set.

You must pass in the user name (several users name allowed)

    my $message = $yt->message;
       $message->summary('look at that!');
       $message->id('video_id_goes_here');
       $message->save('channel_name1','channel_name2');
       #or
       $message->send('channel_name1','channel_name2');

delete

The delete method will actually erase a video message from the user inbox.

The method itself use internally the edit link found after retrieving a list of messages.

The usual flow is to get a list of all the messages

The user check the items to erase (the key should be an url:$message->links->rel('edit')->[0]->href)

You erase the message by passing the key:

    my $message = $yt->message;
       $message->delete($key); 
       
    #you can also retrieve a list of messages and erase them all, in which case,
    #you can loop other the result and call the delete() method:
       
    foreach my $message (@$messages) {
        $message->delete();
    }

none

none

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.

Hey! The above document had some coding errors, which are explained below:
Around line 136:
=back without =over
Around line 173:
=back without =over
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.