HTML::...::hCard(3pm)

๐Ÿ’– HTML::...::hCard ๐Ÿ’–

okay so bestie, we're looking at HTML::Microformats::Format::hCard โ€” the hCard microformat, from the HTML::...::hCard(3pm) page in your perl man pages. sit down, grab a boba, this is gonna be good ๐Ÿง‹โœจ


โœจ NAME โœจ

HTML::Microformats::Format::hCard โ€” the hCard microformat. that's it, that's the whole name, iconic ๐Ÿ‘‘


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

the vibe, in code:

use HTML::Microformats::DocumentContext;
use HTML::Microformats::Format::hCard;

my $context = HTML::Microformats::DocumentContext->new($dom, $uri);
my @cards   = HTML::Microformats::Format::hCard->extract_all(
                  $dom->documentElement, $context);
foreach my $card (@cards)
{
  print $card->get_fn . "\n";
}

like, you make a context, you extract all the cards, you loop and print the fn. slay ๐Ÿ’…


๐ŸŒธ DESCRIPTION ๐ŸŒธ

HTML::Microformats::Format::hCard inherits from HTML::Microformats::Format. so if you wanna know about the property getter/setter methods, the constructors, all of that โ€” go read the base class definition. it's giving "family business" fr fr ๐Ÿซถ

๐Ÿ’œ Additional Method ๐Ÿ’œ

  • to_vcard โ€” this one exports the hCard as a vCard 3.0. it needs RDF::vCard to work, and ngl if that's not available it will throw an error at run-time. no cap ๐Ÿ˜ญ
  • to_vcard4 โ€” this one exports the hCard as a vCard 3.0. it needs RDF::vCard to work, and yep, it will throw an error at run-time if it's not available ๐Ÿ’€
  • to_vcard4_xml โ€” exports the hCard as a vCard XML. it needs RDF::vCard and XML::LibXML to work, and it will throw an error at run-time if it's not available. two dependencies, main character energy โœจ

๐ŸŽ€ MICROFORMAT ๐ŸŽ€

HTML::Microformats::Format::hCard supports hCard as described at <http://microformats.org/wiki/hcard> โ€” with the following additions, and bestie these additions eat:

  • vCard 4.0 terms โ€” this module includes extra property terms taken from the latest vCard 4.0 drafts. for example, the property impp may be used to mark up instant messaging addresses for a contact. so you can put someone's IM handles in there, lowkey genius ๐Ÿ“ฑ the vCard 4.0 property kind is used to record the kind of contact described by the hCard (an individual, an organisation, etc). in many cases this is automatically inferred. the module just knows ๐Ÿ”ฎ
  • Embedded species microformat โ€” if the species microformat (see HTML::Microformats::Format::species) is found embedded within an hCard, then this is taken to be the species of a contact. cute ๐Ÿพ
  • Embedded hMeasure โ€” if the hMeasure microformat (see HTML::Microformats::Format::hMeasure) is found embedded within an hCard, and no item property is provided, then the measurement is taken to pertain to the contact described by the hCard. it's giving "this height belongs to this person" ๐Ÿ“

๐ŸŒˆ RDF OUTPUT ๐ŸŒˆ

data is returned using the W3C's vCard vocabulary (<http://www.w3.org/2006/vcard/ns#>) with some supplemental terms from Toby Inkster's vCard extensions vocabulary (<http://buzzword.org.uk/rdf/vcardx#>) and occasional other terms. a little mix, a little remix, we love a curated selection ๐Ÿ’–

now, after long deliberation on the "has-a/is-a issue" โ€” drama, honestly โ€” the author of this module decided that the holder of a vCard and the vCard itself should be modelled as two separate resources, and this is how the data is returned. periodt. so some information about the holder of the vCard can be inferred from information about the vCard; for instance, the vCard's fn property can be used to determin the holder's foaf:name. this module uses FOAF (<http://xmlns.com/foaf/0.1/>) to represent information about the holder of the vCard. two resources, one friendship ๐Ÿ’ž


๐Ÿ˜ญ BUGS ๐Ÿ˜ญ

please report any bugs to <http://rt.cpan.org/>. don't suffer in silence bestie, tell RT ๐Ÿซถ


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

HTML::Microformats::Format, HTML::Microformats.


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Toby Inkster <tobyink@cpan.org>.


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.


โš ๏ธ 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.

like, no promises, bestie, it is what it is ๐Ÿ’€


and that's the whole page!! this was perl v5.32.1, dated 2021-09-12, from the HTML::...::hCard(3pm) manual. go forth and mark up your contacts, you absolute legend ๐ŸŒŸ๐Ÿ’–

๐Ÿ“ฆ where this page comes from