Overview
SWHook is a simple, dependency free Microdata JavaScript framework. It turns semantic information embedded within the page into useful functionality for end-users. Once added to a website, this automated library will sniff markup on the fly for compatible microdata and transform it into a useful browser-based format for your visitors. This library adds no bloat, it just enhances what's there on the Semantic Web!
Download
You can source the framework from the NPM registry using the following command:
npm install swhook
If you prefer to self-host the framework, you can download the library below:
If you'd like to request a copy of the complete source code (with comments), use this:
<script defer src="https://swhook.com/cache/swhook.js"></script>
If you'd prefer to directly link to a CDN hosted copy of the library for inclusion, use this:
<script defer src="https://swhook.com/cache/swhook-min.js"></script>
Usage
You'll need to include the library within the footer of each page (above the closing HTML tag). The framework will get new features along with updates and bug patches; so if you find issues, or a form of metadata currently unsupported; drop me an email and I'll try and get it fixed / included in the next release cycle.
Install
Add a reference to the library at the body base of your page:
<script defer src="swhook-min.js"></script>
Features
Below is a complete list of the API's, Web standards and Semantic Web Microdata formats that SWHook supports. Within each format I've provided a list of the elements supported and various methods or variables offered. The data-meta attribute lets you change the service visitors will navigate too. Aside from that, file formats identify what semantic data can export to and other features will have their own unique capabilities.
HTML5 Elements
- <a>
- MIME Type Helper
- Pseudo Protoocol Worker
- <abbr>
- data-meta="wiktionary"
- data-meta="lexico"
- data-meta="merriam-webster"
- data-meta="cambridge"
- data-meta="macmillan"
- <address>
- vCard.vcf
- <blockquote>, <cite> & <q>
- Url Detection
- <code>
- Clipboard Copy
- data-meta="codepen"
- data-meta="jsfiddle"
- data-meta="dabblet"
- data-meta="jsbin"
- data-meta="liveweave"
- <html> (Lang)
- data-meta="g-translate"
- data-meta="yandex"
- <link> (Author, Feed, License, Podcast)
- Url Detection
- humans.txt
- change.log, version.txt & history.txt
- Feed MIME Type Helper
- Podcatcher Identifier
- License Identifier
- Navigation Mapper
- <meta> (META, DCMI, OpenGraph, Twitter, Geo)
- Url Detection
- Clipboard Copy
- vCard.vcf
- Event.ics
- Citations (Chicago)
- License Identifier
- Lang Identifier
- Book Identifier
- Geo Identifier
- <time>
- Event.ics
Microformats v1-2
- adr, h-adr, geo, h-geo
- data-meta="g-maps"
- data-meta="apple-maps"
- data-meta="openstreetmaps"
- data-meta="bing-maps"
- data-meta="wego-here"
- rel Attribute
- Author, Payment & Sponsored
- License Identifier
- NoFollow & UGC Detection
- hCalendar, h-event
- Event.ics
- hCard, h-card
- vCard.vcf
- hProduct, h-product
- data-meta="google"
- data-meta="duckduckgo"
- data-meta="bing"
- data-meta="swisscows"
- data-meta="quant"
- hRecipe, h-recipe
- Clipboard Copy
- data-meta="paprika"
- data-meta="bigoven"
- data-meta="yummly"
- data-meta="allrecipes"
- data-meta="mycookbook"
Structured Data
- Audiobook
- data-meta="audible"
- data-meta="google"
- data-meta="kobo"
- data-meta="downpour"
- Book
- data-meta="amazon"
- data-meta="barnesandnoble"
- data-meta="apple"
- data-meta="worldofbooks"
- data-meta="alibris"
- data-meta="google"
- data-meta="ebay"
- Branding
- Url Detection
- Broadcast
- Channel Helper
- Comic
- data-meta="gcd"
- data-meta="google"
- Define
- data-meta="wiktionary"
- data-meta="lexico"
- data-meta="merriam-webster"
- data-meta="cambridge"
- data-meta="macmillan"
- Email
- mailto:
- Event
- Event.ics
- Game
- data-meta="ign"
- data-meta="gamespot"
- data-meta="boardgamegeek"
- data-meta="google"
- data-meta="ebay"
- General
- data-meta="google"
- data-meta="duckduckgo"
- data-meta="bing"
- data-meta="swisscows"
- data-meta="quant"
- Maps
- data-meta="g-maps"
- data-meta="apple-maps"
- data-meta="openstreetmaps"
- data-meta="bing-maps"
- data-meta="wego-here"
- Media
- data-meta="imdb"
- data-meta="tmdb"
- data-meta="rt"
- Movie
- data-meta="amazon"
- data-meta="netflix"
- data-meta="google"
- data-meta="itunes"
- data-meta="ebay"
- Music
- data-meta="spotify"
- data-meta="itunes"
- data-meta="amazon"
- data-meta="youtube"
- data-meta="ebay"
- Organization
- vCard.vcf
- Radio
- data-meta="rss"
- data-meta="itunes"
- data-meta="spotify"
- data-meta="g-play"
- data-meta="android"
- Recipe
- data-meta="paprika"
- data-meta="bigoven"
- data-meta="yummly"
- data-meta="allrecipes"
- data-meta="mycookbook"
- Source
- data-meta="codepen"
- data-meta="jsfiddle"
- data-meta="dabblet"
- data-meta="jsbin"
- data-meta="liveweave"
- Subscription
- data-meta="amazon"
- data-meta="google"
- data-meta="apple"
- data-meta="spotify"
- data-meta="netflix"
External Formats
- DCMI / FOAF (RDF)
- vCard.vcf
- Geo (KML/RDF)
- data-meta="g-maps"
- data-meta="apple-maps"
- data-meta="openstreetmaps"
- data-meta="bing-maps"
- data-meta="wego-here"