hKit Microformats Toolkit for PHP5

hKit is a simple toolkit for extracting common microformats from a page. The page can be presented as a string or a URL, and the result is handed back as a standard PHP array structure. hKit uses SimpleXML for parsing, and therefore requires PHP5.

hKit has a modular structure, with a simple ‘profile’ for each microformat it supports. As the project is very young (June 2006), the only module currently supported is hCard. You can download the latest version on the right. Let me know if you use it somewhere.

In use

    $hKit = new hKit;
    $result = $hKit->getByURL('hcard', '');


23 June 2006 - hKit version 0.4

This release of hKit has a number of small, but important improvements:

  • Refinment of the include-pattern code to prevented nested includes from causing infinite loops
  • Calls to getByURL() now return false if URL can’t be fetched
  • Added pre-flight check to ensure SimpleXML is available
  • Added deduping of class names that are only supposed to appear once
  • Prevented accumulation of multiple ‘value’ values
  • Tuned whitespace handling and treatment of DEL elements

With the hCard profile, hKit now pretty much supports all the parsing rules on the wiki and passes all the hCard tests in the test suite.


  1. ยง Eric Coleman:

    Have you considered proposing this to the PEAR repository, and/or making it Zend Framework compatible?


Download Latest Version

The latest version can be downloaded from Google Code.

Stay Up-to-date

I publish hKit update feeds in RSS and Atom formats.


hKit is licensed under a LGPL 2.1 license.