The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

SYNOPSIS

    #READ COMMENTS
    #query the comments for a video and loop other the results

    use WebService::GData::YouTube;
    
    my $yt = new WebService::GData::YouTube();    
    
    my $comments = $yt->get_comments_for_video_id('2lDekeCDD-J1');
    
    foreach my $comment (@$comments){
        say('-'x50);
        say($comment->content);#the comment
        say($comment->author->[0]->name);#the author name
        say($comment->comment_id);#the comment id
        say($comment->in_reply_to);#is this a comment in reply to an other comment?
    }
    
    #WRITE COMMENTS
    
    use constant KEY=>'...';
        
    my $auth; 
    eval {
        $auth = new WebService::GData::ClientLogin(
           email=>...@gmail.com',
           password=>'...',
           key=>KEY
       );
    };     
    
    #instantiate a comment
    my $comment = new WebService::GData::YouTube($auth)->comment;

       $comment->content('thank you all for watching!');
       $comment->video_id('2lDekeCDD-J1');#attach the comment to a video
       
       #you can set this to be a response to an other comment
       #you must however always set the video_id
       #$comment->in_reply_to('oHekdlwelkjgaQ');
       
    eval {
        $comment->save();
    };
    if(my $error = $@){
        print Dumper($error);
    }  
     

DESCRIPTION

!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::Feed::Entry.

This package represents a Youtube Comment. If you are logged in you can save new comments, create new comments in response to other ones.

You can not, however, edit or erase comments as it is not include in the YouTube API yet.

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

CONSTRUCTOR

new

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

INHERITED METHODS

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

etag

updated

published

category

id

title

GENERAL GET METHODS

The following method is an helper.

comment_id

GENERAL SET/GET METHODS

content

video_id

in_reply_to

QUERY METHODS

This method actually query the service to save your data.

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

save

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

CONFIGURATION AND ENVIRONMENT

none

INCOMPATIBILITIES

none

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.

10 POD Errors

The following errors were encountered while parsing the POD:

Around line 161:

=back without =over

Around line 211:

=back doesn't take any parameters, but you said =back the title is a small part of the content. =over

=back without =over

Around line 223:

=back doesn't take any parameters, but you said =back It looks into the id to retrieve the comment id.

=back without =over

Around line 228:

You forgot a '=back' before '=head2'

Around line 232:

=back doesn't take any parameters, but you said =back This is the comment itself. The package does not encode,clean the data. YouTube replaces HTML with html entities.

=back without =over

Around line 238:

You forgot a '=back' before '=head3'

Around line 240:

=back doesn't take any parameters, but you said =back The video id to which you want to add a comment. =over

=back without =over

Around line 246:

=back doesn't take any parameters, but you said =back It should be set to the comment id you want to reply to. You can use this method to see if a comment is a response to an other comment. =over

=back without =over

Around line 260:

=back without =over

Around line 267:

You forgot a '=back' before '=head1'