Sat March 14
6pm
Meet up at Enid's
That's fine, but just adding a few extra detail enriches the data and makes it easy for the spiders and apps to pull it out and do something useful -- like adding the event to a calendar app.
Here's the same data marked up with the hCalendar syntax
March 14th 6pm
2am 2008
Enid's Bar, Williamsburg, NY
Meetup at Enid's
The two main things we've done here are add date-time stamps around our human readable dates and added a few class names to define the data.
##More Complex exampes##
As with other microformats, hCalendar data is wrapped in tags and the class names used in those tags define what the data relates to. For instance, the dtstart
property let's you know that the text in that HTML element is the starting time for the event.
The only things required for a hCalendar definition are a dtstart
class with the date and time of the event and a summary
that gives a brief description of the event.
Other properties you can define include:
# location
# url
# dtend (ISO date), duration (ISO date duration)
# rdate, rrule
# category, description
# uid
# geo (latitude, longitude)
Here's a more complex example:
I am eating bananas
Posted on: March 14, 2008
Dates: March 14, 2008, 16:30 UTC-
March 16, 2008 01:00 UTC
Banana eating is a public and transparent event.
Filed under:
- Business
Here we have a couple of additional class definitions. The transp
class maps to a similar class in the iCalendar format and tells anything searching through our schedule to not include this event. In other words it won't show up when people search to see when we're busy.
For some even more complex examples, check out the [http://microformats.org/wiki/hcalendar-examples microformats wiki page].
But of course there's no need to write hCalendar info out by hand. There's a handy [http://microformats.org/code/hcalendar/creator hCalendar creator], and even better are the [http://structuredblogging.org/formats.php plugins for Wordpress and Movable Type] that make it easy to add hCalendar markup to events you're writing about.
##Conclusion##
Although perhaps the most complex of the microformats, hCalendar is also one of the more useful ones. Sure, you can publish your schedule as an iCalendar feed, but unless all your friends are tech savvy nerds, they might not know what to do with the iCalendar feed address.
Keep in mind that hCalendar is still a work in progress, if you have ideas or suggestions, head over to the Microformats site and [http://microformats.org/wiki/hcalendar-brainstorming let them know].