hCard is called a "compound Microformat." This means that it contains properties and subproperties.
There are other Microformats (e.g., the VoteLinks Microformat) that are singular and have no properties or subproperties.
They are called elemental Microformats.
Case Sensitivity
The property and subproperty names are case-sensitive.
Use lowercase names: vcard, fn, n, given-name, family-name, and so on.
Root Class Name
The root class name for all hCards is "vcard"
Why isn't the root class name "hcard"? Answer: the hCard Microformat is a 1:1 mapping of the
vCard specification. The hCard classnames are based on the names from vCard.
Valid hCard Root Elements
Recall that the value of any HTML class attribute is a space-separated list of class names.
Thus this is a valid hCard:
<div class="vcard author">...</div>
Read as: "This 'div' element contains both data about a vcard and data about an author".
hCard for Other Things
The previous slides have described how to use hCard to mark up person information.
But hCard may also be used to markup company, organization, and place information.
Some things to note when using hCard to markup company/organization information:
The formatted name (i.e., fn) and organization (i.e., org) properties are the same, so
use class="fn org"
The name - n - property is meaningless (what's the family-name of an organization?), so don't use
the n property.
All the other properties are the same as for marking up person data.
hCard Markup of Hotel Information
Example: markup this data:
Waldorf-Astoria
301 Park Ave.
New York, NY 10022
Reservations: 212.355.3000
Guest Facsimile: 212.872.7272
hCard Markup of Hotel Information
<div class="vcard">
<abbr class="geo" title="40.756561; -73.974056">
<span class="fn org">Waldorf-Astoria</span>
</abbr>
<div class="adr">
<span class="street-address">301 Park Ave.</span><br />
Operator is a "Microformat detection extension for Firefox".
"Operator lets you combine pieces of information on Web sites with applications in ways that
are useful. For instance, Flickr + Google Maps, Upcoming.org + Google Calendar, Yahoo! Local + your address book,
and many more possibilities and permutations. All of these scenarios are possible due to Microformats,
an emerging standard for injecting semantics into HTML."
Click on Google Maps (actually, click on the little triangle next to it), and it will display lat/lon values; now
click on a lat/lon value; Operator will extract the geo information and display it on Google Maps!
Mozilla Operator
Yahoo has marked up their Yahoo! Local pages using Microformats
Go to Yahoo! Local. In the "Search For:" box enter "restaurants" (without the quotes).
In the "Address, City & State" box enter "Boston, MA" (without the quotes). It will show you a bunch of restaurants
in Boston. Select Meritage.
You can view a Google Map of where the photo was taken by using Operator - click on Google Maps in Operator's toolbar.
Mozilla Operator
"You can use Operator to debug your Microformats. Holding down the Ctrl key when you select a
Microformat action will show you the HTML that corresponds that Microformat. In addition, holding
down the Shift key when you select a Microformat action will display our internal representation of
the Microformat data."
On the next slide you can see what Operator displays for Waldorf-Astoria.html when the Ctrl key is held
down while selecting the Google Maps action.
Mozilla Operator
Mozilla Operator
RSS and ATOM are ways to syndicate information. They are XML-based.
hAtom is an HTML-based way to syndicate information.
Here is an hAtom version of a CNN RSS feed;
I have enriched it with a geo Microformat for each news item. On the Operator toolbar Google Maps(7) indicates that there are 7 maps
that can be viewed (nearly every news item has a Google Map associated to it).
Each extension is Javascript code that gets added to Operator; the result of adding the extension is the Operator toolbar gets another menu.
I recommend adding these two extensions to Operator:
Simile Timeline: this extension does a mashup of the event Microformat with MIT's timeline web service. The result is a timeline
showing all the events on the current web page.
Exhibit: this extension does a mashup of the hCard Microformat with MIT's exhibit web service. The result is a user-sortable
list of all the contact information on the current web page.
Adding an Extensions
Here's how to add an extension to Operator:
First install Operator.
Download the Javascript extension (e.g. simile_timeline.js) to your desktop.
Under the (Firefox) Tools menu, select Add-ons.
In the section labeled Operator, click on Options
Click on the tab labeled User Scripts.
Click on the button labeled New.
Adding an Extensions
Continued from previous page:
Navigate to your desktop, where you saved the extension (e.g. simile_timeline.js), and Open it.
Next click on the tab labeled Actions.
Click on the button labeled New.
Open the drop-down list and select the extension (e.g. Simile Timeline).
Restart Firefox
Now there should be a new menu on the Operator toolbar.
Page with Event Microformats
Page with Event Microformats
View Events in a Timeline
Portable Profiles
An hCard about you contains identity information about you.
A Web site could use your hCard to identify you, rather than forcing you to register.
Videntity.org is a third-party OpenID identity provider which imports and exports
your identity information by extracting your hCard from your Web page.
"We're getting closer to the goal of banishing Web registration forms" [Dan Libby]