-
-
10 Mar 2006 11:04:27 UTC
- Distribution: XML-Generator-RSS10-ev
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (410 / 0 / 12)
- Kwalitee
Bus factor: 0- 39.44% Coverage
- License: unknown
- Activity
24 month- Tools
- Download (3.94KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
XML::Generator::RSS10::ev - Support for the Event (ev) RSS 1.0 module
SYNOPSIS
use XML::Generator::RSS10; use DateTime; my $rss = XML::Generator::RSS10->new( Handler => $sax_handler, modules => [ qw(ev) ] ); $rss->item( title => 'Perl Poetry Recitals', link => 'http://www.example.org/diary/perlpoetry.html', description => 'Some lovely Perl poetry, read loudly by Brian Blessed', ev => { startdate => { year => 2006, month => 05, day => 01, hour => 19, minute => 00, second => 00, time_zone => 'local' }, enddate => { year => 2006, month => 05, day => 01, hour => 20, minute => 00, second => 00, time_zone => 'local', }, location => 'Town Hall, Exampleham, UK', organizer => 'Example Organisation, info@example.org', type => 'Recital' } ); $rss->channel( title => 'Diary of Events', link => 'http://www.example.org/diary/', description => 'Forthcoming example events' );
DESCRIPTION
This module extends Dave Rolsky's XML::Generator::RSS10 to provide support for the Event (ev) RSS 1.0 module.
For full details of the Event module specification, see http://web.resource.org/rss/1.0/modules/event/.
Where event data is supplied, the
startdate
andenddate
elements are required. These should be output in W3CDTF date/time format, as defined at http://www.w3.org/TR/NOTE-datetime. To help facilitate this, the module accepts four types of value for either element, which will be formatted to W3CDTF.Define the date using a hashref
If the module is passed a hashref with date and time values as above, it will create a DateTime object from these and use DateTime::Format::W3CDTF to output in W3CDTF.
If the hashref doesn't contain any time values (
hour
,minute
orsecond
), the output won't either.Pass a DateTime object directly
The module will use DateTime::Format::W3CDTF to output the date and time in the correct format.
Note: Since DateTime doesn't distinguish between a date with no time component and midnight, the output of this module when passed a DateTime object directly will always include a time.
Pass a scalar value in epoch seconds
Alternatively, a time value may be supplied in epoch seconds. This will be converted internally to a DateTime object, and thence formatted to W3CDTF.
Pass a string already in in W3CDTF
Any other scalar value passed as a
startdate
orenddate
will be assumed to be already in W3CDTF, and will be output verbatim.CHANGES
Version 0.01: Initial release.
SEE ALSO
XML::Generator::RSS10, DateTime, DateTime::Format::W3CDTF.
AUTHOR
Andrew Green,
<andrew@article7.co.uk>
.Sponsored by Woking Borough Council, http://www.woking.gov.uk/.
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install XML::Generator::RSS10::ev, copy and paste the appropriate command in to your terminal.
cpanm XML::Generator::RSS10::ev
perl -MCPAN -e shell install XML::Generator::RSS10::ev
For more information on module installation, please visit the detailed CPAN module installation guide.