json-implementations

From Microformats Wiki
Jump to navigation Jump to search

JSON Implementations

Introduction

JSON (JavaScript Object Notation; pronounced "Jason") is a lightweight, text-based, human-readable format for representing simple data structures and associative arrays (called "objects"). Although JSON is based on a subset of JavaScript, it is language-independent.


[Placeholder page to document the methods of expressing microformatted content in JSON.]

Implementations

Example Code for testing:

<div id="hcard-Mustermann-Max" class="vcard">
 <a class="url fn" href="http://example.org">Mustermann Max</a>
 <div class="org">Organisation</div>
 <a class="email" href="mailto:mail@examle.org">mail@examle.org</a>

 <div class="adr">
  <div class="street-address">Street</div>
  <span class="locality">City</span>
, 
  <span class="region">State</span>
, 
  <span class="postal-code">12345</span>

  <span class="country-name">Country</span>

 </div>
 <div class="tel">111-222-333</div>
 <a class="url" href="aim:goim?screenname=aim">AIM</a>
 <a class="url" href="ymsgr:sendIM?yim">YIM</a>
</div>

Optimus

Url: http://microformatique.com/optimus/

{
  from: "http://pfefferle.org/static/microformats/hcard-test.html",
  title: "hCard Test",
  hcard: {
    "adr": {
      "street-address": "Street",
      "region": "State",
      "locality": "City",
      "postal-code": "12345",
      "country-name": "Country"
    },
    "email": {
      href: "mailto:mail@examle.org",
      value: "mail@examle.org"
    },
    "fn": "Mustermann Max",
    "org": "Organisation",
    "tel": "111-222-333",
    url: [
      "http://example.org", 
      "http://pfefferle.org/static/microformats/aim:goim?screenname=aim", 
      "http://pfefferle.org/static/microformats/ymsgr:sendIM?yim"
    ]
  }
}

ufXtract

Url: http://lab.backnetwork.com/ufXtract/

// ufXtract 
{
  "vcard": [{
    "fn": "Mustermann Max",
    "n": {
      "given-name": ["Mustermann" ],
      "family-name": ["Max" ]
    },
    "adr": [{
      "street-address": ["Street" ],
      "locality": "City",
      "region": "State",
      "postal-code": "12345",
      "country-name": "Country"
    }],
    "org": {
      "organization-name": "Organisation"
    },
    "email": ["mail@examle.org" ],
    "tel": ["111-222-333" ],
    "url": [
      "http:\/\/example.org\/",
      "aim:goim?screenname=aim",
      "ymsgr:sendIM?yim"
    ]
  }]
}

hKit Service

Url: http://microformatic.com/help/xhtml/hkit/

json[{
  "fn":"Mustermann Max",
  "adr":{
    "street-address":"Street",
    "postal-code":"12345",
    "country-name":"Country",
    "region":"State",
    "locality":"City"
  },
  "email":"mail@examle.org",
  "org":"Organisation",
  "tel":"111-222-333",
  "url":[
    "http:\/\/example.org",
    "http:\/\/pfefferle.org\/static\/microformats\/aim:goim?screenname=aim",
    "http:\/\/pfefferle.org\/static\/microformats\/ymsgr:sendIM?yim"
  ],
  "n":{
    "given-name":"Mustermann",
    "family-name":"Max"
  }
}]

References

  • www.json.org: the original specification, documentation, and list of implementations for many different programming languages.
  • RFC 4627, current formal JSON specification.
  • JSON on Wikipedia