XML::Atom::Ext::Media - An XML::Atom extenstion for the yahoo Media RSS extension


XML-Atom-Ext-Media documentation Contained in the XML-Atom-Ext-Media distribution.

Index


Code Index:

NAME

Top

XML::Atom::Ext::Media - An XML::Atom extenstion for the yahoo Media RSS extension

VERSION

Top

version 0.092840

DESCRIPTION

Top

A for the moment rather crude and simple module for handeling MRSS elements

SYNOPSIS

Top

    use XML::Atom::Feed;
    use XML::Atom::Ext::Media;

    my $feed = XML::Atom::Feed->new(
        URI->new('http://gdata.youtube.com/feeds/api/users/andreasmarienborg/uploads')
    );

    my ($entry) = $feed->entries;
    my ($media) = $entry->media_groups;
    my $content = $media->default_content;
    my $thumb_url = $media->thumbnail->url;

IMPLEMENTATION

Top

The ATTRIBUTES we describe here end up on XML::Atom::Entry-objects, except for element_ns.

ACKNOWLEDGEMENTS

Top

Thank you to XML::Atom::Ext::OpenSearch for being invaluable aid in figuring out how to write extension for XML::Atom. Thank you to MIYAGAWA for XML::Atom.

ATTRIBUTES

Top

media

Will look for any elements of the type <media:group> (as long as xmlns:media='http://search.yahoo.com/mrss/').

In SCALAR context it will return the first sich element, in list context it will return all such elements as a list.

media_groups

Like media, but will return a array ref in SCALAR context, and the list in list context.

element_ns

Returns the XML::Atom::Namespace object representing our xmlns:media="http://search.yahoo.com/mrss/">.

AUTHOR

Top

  Andreas Marienborg <andremar@cpan.org>

COPYRIGHT AND LICENSE

Top


XML-Atom-Ext-Media documentation Contained in the XML-Atom-Ext-Media distribution.

package XML::Atom::Ext::Media;
our $VERSION = '0.092840';


# ABSTRACT: An XML::Atom extenstion for the yahoo Media RSS extension

use strict;
use warnings;

use base qw( XML::Atom::Base );

use XML::Atom::Feed;

use XML::Atom::Ext::Media::Group;
use XML::Atom::Ext::Media::Content;
use XML::Atom::Ext::Media::Thumbnail;



BEGIN {
    XML::Atom::Entry->mk_object_list_accessor(
        group => 'XML::Atom::Ext::Media::Group',
        'media_groups',
    );
# XXX: This conflicts with <entry><content>, how to restrict to NS?
#    XML::Atom::Entry->mk_object_list_accessor(
#        content => 'XML::Atom::Ext::Media::Content'
#    );
}


sub element_ns {
     return XML::Atom::Namespace->new(
        "media" => q{http://search.yahoo.com/mrss/} 
    );
}

1;






__END__