NAME
Catmandu::Exporter::Atom - an Atom exporter
SYNOPSIS
use Catmandu::Exporter::Atom;my $blog_args = {id => "urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6" ,title => "My Blog" ,subtitle => "testing 1.2.3" ,icon => "http://icons.org/test.jpg" ,generator => "Catmandu::Exporter::Atom" ,rights => "Beer license",link => [{'type' => 'text/html' ,'rel' => 'alternate' ,'href' => 'http://www.example.com' ,}],author => [{'name' => 'Daffy' ,'email' => '[email protected]' ,}] ,contributor => [{'name' => 'Bugs' ,'email' => '[email protected]'}],ns => {'dc' => 'http://purl.org/dc/elements/1.1/',},'dc:source' => 'test',};my $exporter = Catmandu::Exporter::Atom->new(%$blog_args);$exporter->add_many($arrayref);$exporter->add_many($iterator);$exporter->add_many(sub { });$exporter->add($hashref);$exporter->add({'title' => 'My Little Pony' ,'subtitle' => 'Data testing for you and me' ,'content' => "sdsadas" ,'summary' => 'Brol 123' ,'id' => '1291821827128172817' ,'author' => {'name' => 'John Doe' ,'email' => '[email protected]' ,} ,'contributor' => {'name' => 'Rabbit, R' ,'email' => '[email protected]' ,'homepage' => 'http://faraway.org/~rabbit' ,} ,'link' => [{'type' => 'text/html' ,'rel' => 'alternate' ,'href' => 'http://www.example.com' ,'title' => 'Test test' ,'length' => '1231' ,'hreflang' => 'eng' ,} ,{'type' => 'text/html' ,'rel' => 'alternate' ,'href' => 'http://www.example2.com' ,}] ,'category' => [{'scheme' => 'http://localhost:8080/roller/adminblog' ,'term' => 'Music',}] ,'rights' => 'Yadadada','dc:subject' => 'Toyz',});printf "exported %d objects\n" , $exporter->count;
Add one object
use Catmandu::Exporter::Atom;my $exporter = Catmandu::Exporter::Atom->new();print $exporter->add($hashref);
Add many objects to exporter
use Catmandu::Exporter::Atom;my $exporter = Catmandu::Exporter::Atom->new();print $exporter->add_many($arrayref);
Add many objects from an iterator
use Catmandu::Exporter::Atom;my $exporter = Catmandu::Exporter::Atom->new();my $iterator = Catmandu::Importer::
Fix your data while exporting the data
use Catmandu::Exporter::Atom;my $exporter = Catmandu::Exporter::Atom->new(fix => 'fix.txt');# where fix.txt looks for example:# add_field()# delete# mvprint $exporter->add($data);
SEE ALSO
Catmandu::Exporter