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.
$hKit = new hKit;
$result = $hKit->getByURL('hcard', 'http://microformats.org/');
22 June 2006 - hKit version 0.3
Last night I dropped another update to hKit – version 0.3. Download.
I’m still focussing on getting hCard support properly working before branching out to other ÂµFs.
Key improvements are:
- Support for include-pattern
- Support for td@headers pattern
- Performs implied n-optimization expansion, rather than leaving it to the user
- Passes all hCard tests, apart from the telephone example cited yesterday
Problems I know I haven’t dealt with yet, but have in-the-shower solutions for are:
- Infinite loop protection for include-pattern
- Nested formats, e.g. hCard inside hReview, or XFN inside hCard, or both!
- Flight-checks and fallover for different PHP environments
Any testing and feedback is appreciated.