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.
Create a WebService::GData::YouTube::Feed::VideoMessage instance.
Parameters:
jsonc_video_entry_feed:Object
authorization:Object
or
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.
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.
This returns the Author of the message.
This returns the published tag which, in this context, is equal to the date the mail was sent.
This is the message itself. The package does not encode,clean the data. YouTube replaces HTML with html entities.
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.
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');
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
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.
2 POD Errors
The following errors were encountered while parsing the POD:
=back without =over
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.