Catmandu::Exporter::Atom(3pm) | User Contributed Perl Documentation | Catmandu::Exporter::Atom(3pm) |
Catmandu::Exporter::Atom - an Atom exporter
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' => 'duck@toons.be' , } ] , contributor => [ { 'name' => 'Bugs' , 'email' => 'bunny@toons.be' } ], 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' => 'john@farwaway.org' , } , 'contributor' => { 'name' => 'Rabbit, R' , 'email' => 'r.rabbit@farwaway.org' , '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;
use Catmandu::Exporter::Atom; my $exporter = Catmandu::Exporter::Atom->new(); print $exporter->add($hashref);
use Catmandu::Exporter::Atom; my $exporter = Catmandu::Exporter::Atom->new(); print $exporter->add_many($arrayref);
use Catmandu::Exporter::Atom; my $exporter = Catmandu::Exporter::Atom->new(); my $iterator = Catmandu::Importer:: print
use Catmandu::Exporter::Atom; my $exporter = Catmandu::Exporter::Atom->new(fix => 'fix.txt'); # where fix.txt looks for example: # add_field() # delete # mv print $exporter->add($data);
Catmandu::Exporter
2020-04-01 | perl v5.30.0 |