HTML::...at::adr(3pm)

โœจ NAME โœจ

so bestie, gather round ๐Ÿ’– this is HTML::Microformats::Format::adr (section 3pm, the perl one) โ€” aka the adr microformat, and she's here to parse addresses like it's her whole job (it is ๐Ÿ’…).


๐ŸŒธ SYNOPSIS ๐ŸŒธ

okay so you literally just do this:

use Data::Dumper;
use HTML::Microformats::DocumentContext;
use HTML::Microformats::Format::adr;

my $context = HTML::Microformats::DocumentContext->new($dom, $uri);
my @adrs    = HTML::Microformats::Format::adr->extract_all(
                  $dom->documentElement, $context);
foreach my $adr (@adrs)
{
  print Dumper($adr->data) . "\n";
}

that's it. that's the whole ritual. you build a context, you extract_all the adrs off the document element, and then you dump $adr->data for each one and vibe. ๐Ÿฆ‹


๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

HTML::Microformats::Format::adr inherits from HTML::Microformats::Format. that's the base class, bestie โ€” and if you wanna know how property getter/setter methods work, or how constructors work, or literally any of the machinery, you go read the base class definition. she's got the lore. ๐Ÿ“š


๐ŸŽ€ MICROFORMAT ๐ŸŽ€

HTML::Microformats::Format::adr supports adr exactly as it's described at http://microformats.org/wiki/adr โ€” no cap โ€” but with these two additions, and honestly? they're the moment. ๐Ÿ‘‘

  • 'type' property โ€” this module is what HTML::Microformats::Format::hCard uses to handle addresses inside the hCard microformat. hCard addresses come with a 'type' property that tells you what kind of address it is (like home, work, etc.). This module supports the 'type' property whether the address is part of an hCard or not. ๐Ÿ ๐Ÿ’ผ
  • Embedded geo microformat โ€” if an instance of the geo microformat is found embedded inside an address, that geographic location gets associated with the address. not them linking up like that ๐Ÿ˜ญ it's giving matchmaker.

๐ŸŒˆ RDF OUTPUT ๐ŸŒˆ

the data comes back using the W3C's vCard vocabulary (http://www.w3.org/2006/vcard/ns#), plus the occasional other terms when the vibe calls for it.

so like, the way HTML::Microformats::Format::hCard differentiates between the business card and the entity the card represents? this module does that same little split, but between the address and the location represented by it. ๐Ÿซถ

  • the former โ€” the address โ€” is an abstract social construction, and its definition gets affected by ephemeral political boundaries (yes bestie, borders are that girl and she's always moving ๐Ÿ’€)
  • the latter โ€” the location โ€” is a physical place. like, an actual spot on the planet.

theoretically, multiple addresses could represent the same location, or overlapping locations โ€” though this module does not generate any data where that is the case. so don't come for her about it ๐Ÿ™ˆ

where possible, the module uses Locale::Country to work out the two letter ISO code for the country of the location, and includes that in the RDF output. little sprinkle of โœจinternational flairโœจ.


๐Ÿ˜ญ BUGS ๐Ÿ˜ญ

please report any bugs to http://rt.cpan.org/. she wants to know. tell her everything. ๐Ÿ“ฎ


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

  • HTML::Microformats::Format
  • HTML::Microformats
  • HTML::Microformats::Format::hCard
  • HTML::Microformats::Format::geo

the whole friend group, honestly. ๐Ÿ’–


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Toby Inkster <tobyink@cpan.org>. icon. legend. the moment. ๐ŸŒŸ


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 bestie she is literally telling you she comes with zero promises, take it or leave it, no refunds, no takebacks. read that twice. ๐Ÿซฃ


and that's the page, mwah ๐Ÿ’… โ€” this was HTML::...at::adr(3pm), from perl v5.32.1, dated 2021-09-12. go forth and parse addresses, you absolute main character ๐Ÿฆ‹โœจ

๐Ÿ“ฆ where this page comes from