Skip to content

Instantly share code, notes, and snippets.

@HadrienGardeur
Last active March 16, 2017 22:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HadrienGardeur/e6678c6b242a065704ad to your computer and use it in GitHub Desktop.
Save HadrienGardeur/e6678c6b242a065704ad to your computer and use it in GitHub Desktop.
Attempt to port OPDS to the new serialization for EPUB (application/epub+json), might be OPDS 2.0 (application/opds+json)
{
"@context": "http://opds-spec.org/opds.jsonld",
"metadata": {"title": "eBook Store"},
"links": [
{"rel": "self", "href": "/navigation.json", "type": "application/opds+json"},
{"rel": "shelf", "href": "/shelf", "type": "application/opds+json"}
],
"navigation": [
{"title": "New Releases", "href": "/new", "type": "application/opds+json"},
{"title": "Best Selling", "href": "/top", "type": "application/opds+json"},
{"title": "Categories", "href": "/categories", "type": "application/opds+json"}
]
}
{
"@context": "http://opds-spec.org/opds.jsonld",
"metadata": {"title": "New Releases"},
"links": [
{"rel": "self", "href": "/acquisition.json", "type": "application/opds+json"},
{"rel": "search", "href": "/search?q={query}", "type": "application/opds+json"},
{"rel": "next", "href": "/?page=2", "type": "application/opds+json"}
],
"publications": [
{
"metadata": {
"@type": "http://schema.org/EBook",
"title": "The Girl in the Spider's Web",
"author": "David Lagercrantz",
"translator": "George Goulding",
"identifier": "urn:isbn:9780385354288",
"modified": "2016-02-18T10:32:18Z",
"subject": {"name": "Thrillers / Technological", "code": "FIC036000", "scheme": "https://www.bisg.org/bisac/"},
"belongs_to": {"series": {"title": "Millenium", "position": 4}}
},
"links": [
{"rel": "self", "href": "http://example.org/publication.json", "type": "application/opds-publication+json"},
{"rel": "related", "href": "http://example.org/recommended.json", "type": "application/opds+json", "title": "Recommended Books"}
],
"images": [
{"href": "/cover.jpg", "type": "image/jpeg", "height": "1000", "width": "700"},
{"href": "/cover.svg", "type": "image/svg+xml"},
{"href": "/cover.jpg?size=smaller", "type": "image/jpeg", "height": "333", "width": "233"}
],
"acquire": [
{"rel": "buy", "href": "/buy", "type": "application/epub+zip", "price": {"currency": "USD", "value": "13.99"}}
]
}
]
}
{
"@context": "http://opds-spec.org/opds.jsonld",
"metadata": {"title": "New Releases"},
"links": [
{"rel": "self", "href": "/acquisition.json", "type": "application/opds+json"},
{"rel": "search", "href": "/search?q={query}", "type": "application/opds+json"},
{"rel": "next", "href": "/?page=2", "type": "application/opds+json"}
],
"facets": [
{
"metadata": {"title": "Language"},
"links": [
{ "href": "/fr", "title": "French", "rel": ["default", "active"]},
{ "href": "/en", "title": "English"}
]
},
{
"metadata": {"title": "Sort"},
"links": [
{"href": "/popular", "title": "Popular", "rel": "default"},
{"href": "/new", "title": "New"}
]
}
],
"breadcrumbs": [{
"links": [
{"title": "All Books", "href": "/feeds/All_Books"},
{"title": "Fiction", "href": "/feeds/Fiction"},
{"title": "Thrillers", "href": "/feeds/Thrillers"}
]
}],
"publications": [
{
"metadata": {
"@type": "http://schema.org/EBook",
"title": "The Girl in the Spider's Web",
"author": "David Lagercrantz",
"translator": "George Goulding",
"identifier": "urn:isbn:9780385354288",
"modified": "2016-02-18T10:32:18Z",
"subject": {"name": "Thrillers / Technological", "code": "FIC036000", "scheme": "https://www.bisg.org/bisac/"},
"belongs_to": {"series": {"title": "Millenium", "position": 4}}
},
"links": [
{"rel": "self", "href": "http://example.org/publication.json", "type": "application/opds-publication+json"},
{"rel": "related", "href": "http://example.org/recommended.json", "type": "application/opds+json", "title": "Recommended Books"}
],
"images": [
{"href": "/cover.jpg", "type": "image/jpeg", "height": "1000", "width": "700"},
{"href": "/cover.svg", "type": "image/svg+xml"},
{"href": "/cover.jpg?size=smaller", "type": "image/jpeg", "height": "333", "width": "233"}
],
"acquire": [
{"rel": "buy", "href": "/buy", "type": "application/epub+zip", "price": {"currency": "USD", "value": "13.99"}}
]
}
]
}
{
"@context": "http://opds-spec.org/opds.jsonld",
"metadata": {"title": "eBook Store"},
"links": [
{"rel": "self", "href": "/navigation.json", "type": "application/opds+json"},
{"rel": "search", "href": "/search?q={query}", "type": "application/opds+json"},
{"rel": "shelf", "href": "/shelf", "type": "application/opds+json"}
],
"groups": [
{
"metadata": {"title": "Browse"},
"navigation": [
{"title": "New Releases", "href": "/new", "type": "application/opds+json"},
{"title": "Best Selling", "href": "/top", "type": "application/opds+json"},
{"title": "Categories", "href": "/categories", "type": "application/opds+json"}
],
},
{
"metadata": {"title": "Fiction"},
"links": [{"rel": "self", "href": "/fiction.json", "type": "application/opds+json"}],
"publications": []
},
{
"metadata": {"title": "Non-Fiction"},
"links": [{"rel": "self", "href": "/non-fiction.json", "type": "application/opds+json"}],
"publications": []
},
{
"metadata": {"title": "Young Adult (No Link)"},
"publications": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment