a component for extracting HTML5 microdata in the browser
npm install microdata
a component for extracting HTML5 microdata in the browser
microdata uses component/query, a wrapper for selector engines.
If you don't plug a selector engine into it, it'll default to querySelector/querySelectorAll.
See the caniuse page for querySelector/querySelectorAll for more information.
$ component install nathan7/microdata
or
$ npm install microdata
or
for those still in the Dark Ages, a standalone version.
example:
``javascript`
microdata('http://data-vocabulary.org/Person')`
example return value:javascript``
[{
"_type": "http://data-vocabulary.org/Person",
"photo": "http://diveintohtml5.info/examples/2000_05_mark.jpg",
"name": "Mark Pilgrim",
"title": "Developer advocate",
"affiliation": "Google, Inc.",
"address": {
"_type": "http://data-vocabulary.org/Address",
"street-address": "100 Main Street",
"locality": "Anytown",
"region": "PA",
"postal-code": "19999",
"country-name": "USA"
},
"url": ["http://diveintomark.org/", "http://www.google.com/profiles/pilgrim", "http://www.reddit.com/user/MarkPilgrim", "http://www.twitter.com/diveintomark"]
}]
MIT