The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WebService::YouTube - Perl interfece to YouTube

VERSION

This document describes WebService::YouTube $Revision: 44 $

SYNOPSIS

    use WebService::YouTube;
    
    my $youtube = WebService::YouTube->new( { dev_id => YOUR_DEV_ID } );
    
    # Call API youtube.videos.list_featured
    my @videos = $youtube->videos_list_featured;
    foreach my $video (@videos) {
        # $video->isa('WebService::YouTube::Video');
    }

or

    use WebService::YouTube;
    
    my $youtube = WebService::YouTube->new;
    
    # Call RSS API recently_added
    my @videos = $youtube->recently_added;
    foreach my $video (@videos) {
        # $video->isa('WebService::YouTube::Video');
    }

DESCRIPTION

This is a Perl interface for YouTube API and RSS. See Developers Page http://youtube.com/dev and About RSS http://www.youtube.com/rssls for details.

SUBROUTINES/METHODS

new(\%fields)

Creates and returns a new WebService::YouTube object. %fields can contain parameters enumerated in "ACCESSORS" section.

parse_xml($xml)

Parses XML and returns the result. $xml should be an object that XML::Simple can understand.

videos_list_featured( )

Returns an array of parsed result.

See http://youtube.com/dev_api_ref?m=youtube.videos.list_featured for details.

videos_get_details( $video_id )

Returns an array of parsed result.

See http://youtube.com/dev_api_ref?m=youtube.videos.get_details for details.

parse_rss($rss)

Parses RSS and returns the result. $rss should be an object that XML::Simple can understand.

recently_added( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

recently_featured( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

top_favorites( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

top_rated( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

most_discussed_month( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

most_discussed_today( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

most_discussed_week( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

top_viewed( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

top_viewed_month( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

top_viewed_today( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

top_viewed_week( )

Returns an array of parsed result.

See http://youtube.com/rssls for details.

ACCESSORS

dev_id : Developer ID

DIAGNOSTICS

dev_id is not defined

Developer ID is required when you call API of YouTube.

CONFIGURATION AND ENVIRONMENT

WebService::YouTube requires no configuration files or environment variables.

DEPENDENCIES

version, Class::Accessor::Fast, LWP::Simple, XML::Simple

INCOMPATIBILITIES

WWW::YouTube

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-webservice-youtube@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-YouTube. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

AUTHOR

Hironori Yoshida <yoshida@cpan.org>

LICENSE AND COPYRIGHT

Copyright (c) 2006, Hironori Yoshida <yoshida@cpan.org>. All rights reserved.

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