XML::FeedPP::Plugin::AddMP3 - FeedPP Plugin for adding MP3 as item.
use XML::FeedPP; my $feed = XML::FeedPP->new( 'index.rss' ); $feed->call(AddMP3 => './mp3/test.mp3'); $feed->to_file('rss.xml');
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.
This plugin allows some optoinal arguments following:
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.
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 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'.
XML::FeedPP, Path::Class, MP3::Info
Encode, or Jcode (for Japanese users)
XML::FeedPP
http://www.apple.com/itunes/store/podcaststechspecs.html (Podcast specification)
Makio Tsukamoto <tsukamoto@gmail.com>
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.
To install XML::FeedPP::Plugin::AddMP3, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::FeedPP::Plugin::AddMP3
CPAN shell
perl -MCPAN -e shell install XML::FeedPP::Plugin::AddMP3
For more information on module installation, please visit the detailed CPAN module installation guide.