NAME

Mojo::Feed::Item::Enclosure - represents a file enclosure in an item from an RSS/Atom feed.

SYNOPSIS

use Mojo::Feed;

my $feed = Mojo::Feed->new("atom.xml");

my $item = $feed->items->first;

print $item->title, $item->author, $item->published, "\n";

DESCRIPTION

Mojo::Feed::Item::Enclosure is an Object wrapper for an enclosure from an RSS or Atom feed item.

ATTRIBUTES

Mojo::Feed::Item::Enclosure implements the following attributes.

type

Mime type of the enclosure file

length

Length of the enclosure payload

url

URL for downloading the enclosure content

METHODS

Mojo::Feed::Item::Enclosure inherits all methods from Mojo::Base and adds the following ones:

to_hash

my $hash = $enclosure->to_hash;
print $hash->{url};

Return a hash reference representing the enclosure.

to_string

Return a XML serialized text of the enclosure's Mojo::DOM node. Note that this can be different from the original XML text in the feed.

CREDITS

Dotan Dimet

Mario Domgoergen

Some tests adapted from Feed::Find and XML:Feed, Feed auto-discovery adapted from Feed::Find.

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018-2019 by Dotan Dimet <dotan@corky.net>.

This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.

Test data (web pages, feeds and excerpts) included in this package is intended for testing purposes only, and is not meant in any way to infringe on the rights of the respective authors.

AUTHOR

Dotan Dimet <dotan@corky.net>