Microformats – building blocks for data-rich web pages

https://news.ycombinator.com/rss Hits: 8
Summary

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: If there’s not currently a parser available for your language of choice, you have a few options: Call the command-line tools provided by one of the existing libraries from your code, and consume the JSON they provide Make use of one of the online mf2 parsers capable of parsing sites, and consume the JSON it returns (only recommended for very low volume usage!) Write your own microformats 2 parser! There are plenty of people happy to help, and a language-agnostic test suite you can plug your implementation into for testing. Considerations During Fetching and Parsing Most real-world microformats data is fetched from a URL, which could potentially redirect to a different URL one or more times. The final URL in the redirect chain is called the “effect...

First seen: 2025-10-07 10:09

Last seen: 2025-10-07 17:10