Mojo::Feed::Item - represents an item from an RSS/Atom feed.
use Mojo::Feed; my $feed = Mojo::Feed->new("atom.xml"); my $item = $feed->items->first; print $item->title, $item->author, $item->published, "\n";
Mojo::Feed::Item is an Object wrapper for a item from an RSS or Atom Feed.
Mojo::Feed::Item implements the following attributes.
May be filled with content:encoded, xhtml:body or description fields
content:encoded
xhtml:body
description
Will be equal to link or guid if it is undefined and either of those fields exists
link
guid
Optional - usually a shorter form of the content (may be filled with summary if description is missing)
summary
Optional
Time in epoch seconds (may be filled with pubDate, dc:date, created, issued, updated or modified)
pubDate
dc:date
created
issued
updated
modified
May be filled from author or dc:creator
author
dc:creator
Optional - array ref of tags, categories or dc:subjects.
tags
categories
dc:subjects
Optional - array ref of enclosures, each a hashref with the keys url, type and length.
A reference to the feed this item belongs to. Note that this is a weak reference, so it maybe undefined, if the parent feed is no longer in scope.
Mojo::Feed::Item inherits all methods from Mojo::Base and adds the following ones:
my $hash = $item->to_hash; print $hash->{title};
Return a hash reference representing the item.
Return a XML serialized text of the item's Mojo::DOM node. Note that this can be different from the original XML text in the feed.
Dotan Dimet
Mario Domgoergen
Copyright (C) Dotan Dimet.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Dotan Dimet <dotan@corky.net>
To install Mojo::Feed, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojo::Feed
CPAN shell
perl -MCPAN -e shell install Mojo::Feed
For more information on module installation, please visit the detailed CPAN module installation guide.