HTML::...::XMDP(3pm)
π HTML::...::XMDP(3pm) β aka the XMDP microformat, bestie edition π
okay so hi, you found the manpage for HTML::Microformats::Format::XMDP, which is a Perl module living in the HTML::...::XMDP slot of the User Contributed Perl Documentation. it's the XMDP microformat handler and it's lowkey iconic, so let's get into it π«Ά
β¨ NAME β¨
HTML::Microformats::Format::XMDP β the XMDP microformat. that's it, that's the whole name, no notes π
πΈ SYNOPSIS πΈ
here's the vibe, literally copy-paste coded:
use HTML::Microformats;
use LWP::Simple qw[get];
use RDF::TrineShortcuts;
my $uri = 'http://microformats.org/profile/hcard';
my $html = get($uri);
my $doc = HTML::Microformats->new_document($html, $uri);
$doc->assume_all_profiles;
my @xmdp_objects = $doc->objects('XMDP');
foreach my $xo (@xmdp_objects)
{
print $xo->serialise_model(
as => 'Turtle',
namespaces => {
rdfs => 'http://www.w3.org/2000/01/rdf-schema#',
hcard => 'http://microformats.org/profile/hcard#',
},
);
print "########\n\n";
}
so you grab a URI, fetch the HTML with LWP::Simple's get, build a document, tell it to assume_all_profiles, then pull out all the 'XMDP' objects with objects and serialise each one's model as Turtle with your custom namespaces hash. then you print a little "########\n\n" divider between them because we're organised and we're cute π
π¦ DESCRIPTION π¦
HTML::Microformats::Format::XMDP inherits from HTML::Microformats::Format. so if you're wondering about the property getter/setter methods, the constructors, all that good stuff β go read the base class definition, it's all spelled out there. not me redirecting you, but also yes me redirecting you π
and plot twist: HTML::Microformats::Format::XMDP also inherits from HTML::Microformats::Format::XOXO, and the "data" method returns the exact same structure. family tree moment, the way that it shares dna π
π MICROFORMAT π
HTML::Microformats::Format::XMDP supports XMDP as described at <http://gmpg.org/xmdp/>. go read the spec, bestie, it's right there π§
π RDF OUTPUT π
the data comes back using RDFS. no cap. β
π BUGS π
okay here's the one thing you need to know, and I'm saying it dramatically because it matters: a limitation is that for any <dd> element with <dl> children, only the first such <dl> is looked at. so what does that mean for you? it means the XFN 1.1 profile document is only partially parsable. π most other microformat profile documents can be properly parsed though, so like, it's giving very specific edge case, but still β be aware.
and if you find bugs, please report any bugs to <http://rt.cpan.org/>. do it for the culture π
π₯ SEE ALSO π₯
HTML::Microformats::FormatHTML::Microformats
go read those too, iykyk π«Ά
π AUTHOR π
Toby Inkster <tobyink@cpan.org>. absolute legend, we stan π
π COPYRIGHT AND LICENCE π
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. slay, permissive licensing, we love to see it β¨
πΈ 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.
read it and weep bestie, no warranty, we're all just vibing on our own π
and that's the whole page!! this lil doc is from perl v5.32.1, dated 2021-09-12, and it's part of the User Contributed Perl Documentation β so yeah, contributed by the people, for the people. mwah, go parse some profiles π¦π
π¦ where this page comes from
- debian bookworm: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhtml-microformats-perl 0.105-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms