HTML::...losure(3pm)

✨ NAME ✨

so like, this page is all about HTML::Microformats::Format::RelEnclosure β€” the rel-enclosure microformat πŸ’– (and yes bestie, it lives in the 3pm perl section, iykyk)


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the vibe, literally copy-paste coded exactly like this:

my @enclosures = HTML::Microformats::Format::RelEnclosure->extract_all(
                  $doc->documentElement, $context);
foreach my $e (@enclosures)
{
  my $type = $l->get_type || 'unknown';
  printf("%s (%s)\n"), $l->get_href, $type);
}
ngl that printf line is giving exactly-what-it-says, so don't go "fixing" it on me, bestie β€” it's quoted verbatim 🫢

πŸ’… DESCRIPTION πŸ’…

HTML::Microformats::Format::RelEnclosure inherits from HTML::Microformats::Format_Rel. That's the whole family tree moment 🌸 β€” the base class definition is where you go for the tea on property getter/setter methods, constructors, etc. etc. Go read it, it ate.

🌈 Additional Method 🌈

  • $relenc->get_type() β€” bestie this one hands you the media type (aka the Content-Type) of the resource that's being linked to. Where does it come from? The HTML type attribute. And if that attribute isn't there? It returns undef. No type, no tea. πŸ’€

πŸ¦‹ MICROFORMAT πŸ¦‹

HTML::Microformats::Format::RelEnclosure supports rel-enclosure exactly as described over at <http://microformats.org/wiki/rel-enclosure>. iconic, we love a spec link πŸ‘‘

Also important, no cap: the title attribute on the link, and the linked text, are taken to be significant. Both of them. Periodt.


πŸ”₯ RDF OUTPUT πŸ”₯

Data comes back using the RSS Enclosures vocabulary (<http://purl.oclc.org/net/rss_2.0/enc#>) plus occasional other terms. So like, mostly that vocab, sometimes a lil guest star ✨


😭 BUGS 😭

Found a bug? Please report it to <http://rt.cpan.org/>. Don't be shy, bestie, RT is right there 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

  • HTML::Microformats::Format_Rel
  • HTML::Microformats
  • HTML::Microformats::Format::hAtom

go read those next, it's giving required reading πŸ“š


🌸 AUTHOR 🌸

Toby Inkster <tobyink@cpan.org>. yes, THE Toby Inkster πŸ’–


Copyright 2008-2012 Toby Inkster

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. same terms as Perl itself, literally, that's the deal ✨


πŸ’€ DISCLAIMER OF WARRANTIES πŸ’€

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

bestie read that one again. NO warranties. none. zero. not even the implied ones. it's giving "you're on your own" energy and I need you to respect it πŸ™ˆ

perl v5.32.1 🌈 2021-09-12 β€” that's the version and the date this page was born, and that's a wrap on HTML::...losure(3pm) πŸ’… mwah, go enclose something cute πŸŽ€

πŸ“¦ where this page comes from