NAME

XML::FeedPP::Plugin::AddMP3 - FeedPP Plugin for adding MP3 as item.

SYNOPSIS

use XML::FeedPP;
my $feed = XML::FeedPP->new( 'index.rss' );
$feed->call(AddMP3 => './mp3/test.mp3');
$feed->to_file('rss.xml');

DESCRIPTION

This plugin generate new feed item for specified MP3 file.

$feed->call(AddMP3 => './mp3/test.mp3');

And set default value for the item's title, author, enclosure url, enclosure length, enclosure type with MP3 TAGs and INFOs.

If use_itune option is specified, xmlns:itunes is added to feed. And additional default value for itunes:author, itunes:subtitle, itunes:duration, itunes:keywords are set.

Returns added item, or undef.

NOTE: If those values includes non-UTF-8 characters, it tries to convert with Encode, or Jcode module. When both of them are avaliable, It calls Carp::carp, and continues process.

OPTIONS

This plugin allows some optoinal arguments following:

base_dir

By default, url attribute of enclosure tag is set to file argument. If base_dir is specified, url attribute is converted to relative path from base_dir.

base_url

If base_url is specified, url attribute is converted as relative path from base_url.

By default, link value is set to the feed's link value. If link_url is specified, link value is set to link_url.

use_itunes

Use itunes name space, and add tags in the name space. See also http://www.apple.com/itunes/store/podcaststechspecs.html

For example,

my %opt = (
    base_dir   => './mp3'
    base_url   => 'http://example.com/podcast/files',
    link_url   => 'http://example.com/podcast',
    use_itunes => 1,
);
$feed->call(AddMP3 => './mp3/test.mp3');

At first, URL is set to './mp3/test.mp3'. Then, base_dir is specified in this case, URL is chenged to 'test.mp3'. Alos base_url is specified in this case, so URL is chenged to 'http://example.com/podcast/files/test.mp3'.

MODULE DEPENDENCIES

XML::FeedPP, Path::Class, MP3::Info

MODULE RECOMMENDED

Encode, or Jcode (for Japanese users)

SEE ALSO

XML::FeedPP

http://www.apple.com/itunes/store/podcaststechspecs.html (Podcast specification)

AUTHOR

Makio Tsukamoto <tsukamoto@gmail.com>

COPYRIGHT AND LICENSE

Copyright (c) 2007 Makio Tsukamoto. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.