[uf-discuss] Generically converting JSON to POSH

Nirmal Patel nirmal at gatech.edu
Sun Jul 13 08:04:13 PDT 2008


I've been experimenting with some ideas on ways of properly turning
JSON[1] objects into POSH. I have posted my first attempt at
http://nirmalpatel.com/json2posh along with further details. Any
feedback is greatly appreciated.

I used the code to convert the JSON object returned by Twitter and
then used CSS to style the results. The CSS can be toggled to see the
output before/after.

I am converting arrays into ordered lists and dictionaries into
unordered lists where each list item has a classname that is equal to
the key in the key/value pair.

Strings are converted to text nodes with the exception that links are
found through regex and automatically converted to anchor nodes.

Numbers, booleans and null are converted to text nodes

Thank you for your time.

[1] http://www.json.org

Nirmal Patel

More information about the microformats-discuss mailing list