Ufxtract

Ufxtract is a microformats API that can easily extract microformats from any web page. It can output the results in JSON, XML or text format. There is JSON-P support for use with JavaScript.

Try it out...

Example API call

http://ufxtract.com/api/?url=http://microformats.org/&format=hcard&output=json

API parameters

url
The address of the web page containing the microformats
format
The type of microformat you want to parse
output
The type of output ie xml, json or text
callback
A JSON-P function name to wrap the data in. Only works went the output is set to JSON
report
Returns a summary of parsing information

Example JSON output

A single hCard on a page would return output like the example below. The format is based on ufJson documented on the microformats wiki. The API compress the JSON output removing all spaces and returns. If you would like a more readable layout try using the Javascript beautifier.

{
    "microformats": {
        "vcard": [{
            "fn": "Tantek",
            "nickname": ["Tantek"],
            "photo": ["http:\/\/www.gravatar.com\/avatar\/02cd45622e90350cc061aaaa02229195?s=16&d=http:\/\/www.gravatar.com\/avatar\/ad516503a11cd5ca435acc9bb6523536?s=16&r=PG"],
            "url": ["http:\/\/tantek.com\/"]
        }],
    }
}

Errors

Ufxtract has a very simple in built error reporting. Below is an example of calling the API with an empty URL.

{
    "microformats": {
        "errors": [{
            "msg": "Invalid URI: The hostname could not be parsed.",
            "url": "http:\/\/"
        }]
    }
}

Other tools

 

© 2007 - 2009 Glenn Jones. All Rights Reserved. Thanks to Madgex for hosting Ufxtract