Tech News
← Back to articles

Microformats – building blocks for data-rich web pages

read original related products more articles

A (very) belated follow up to Getting Started with Microformats 2, covering the basics of consuming and using microformats 2 data. Originally posted on waterpigs.co.uk.

More and more people are using microformats 2 to mark up profiles, posts, events and other data on their personal sites, enabling developers to build applications which use this data in useful and interesting ways. Whether you want to add basic support for webmention comments to your personal site, or have ambitious plans for a structured-data-aware-social-graph-search-engine-super-feed-reader, you’re going to need a solid grasp of how to parse and handle microformats 2 data.

Choose a Parser

To turn a web page containing data marked up with microformats 2 (or classic microformats, if supported) into a canonical MF2 JSON data structure, you’ll need a parser.

At the time of writing, there are actively supported microformats 2 parsers available for the following programming languages:

Parsers for various other languages exist, but might not be actively supported or support recent changes to the parsing specification.

There are also various websites which you can use to experiment with microformats markup without having to download a library and write any code:

My own live-updating php-mf2 sandbox

The various parser comparison tools hosted on microformats.io

Aaron Parecki’s pin13.net microformats parser for parsing either URLs or HTML fragments

... continue reading