Skip to content

Instantly share code, notes, and snippets.

@musubu
Created April 5, 2012 02:49
Show Gist options
  • Save musubu/2307628 to your computer and use it in GitHub Desktop.
Save musubu/2307628 to your computer and use it in GitHub Desktop.
YAMLからOPDS取得フィードを生成するためのサンプルのYAML
# ---------------------------------------------------------------------
# YAMLからOPDS取得フィードを生成するためのサンプルのYAML
# ---------------------------------------------------------------------
# 行頭に「#」がある行はコメントです。そこに何を書いてもパソコンには処理されません。
# インデント(行の最初の空白)にタブを使うことはできません。2つの半角スペース(空白文字)を使ってください。
# よく分からない場合はこのファイルの内容をコピーして、実際の内容で書き換えることが無難です。
# YAMLの書き方については http://ja.wikipedia.org/wiki/YAML を参照してください。
# ----------------------------
# OPDS取得フィードそのものについての情報(タイトル等)
# ----------------------------
'@':
-
xmlns: http://www.w3.org/2005/Atom
-
"xmlns:dc": http://purl.org/dc/terms/
-
"xmlns:opds": http://opds-spec.org/2010/catalog
-
"xml:lang": "ja"
id: http://example.com/all.opds
title: サンプル出版社のOPDS取得フィード
icon: http://example.com/favicon.ico
updated: 2012-04-04T00:00:00Z
links:
-
'@':
href: http://example.com/
type: text/html
rel: alternate
title: サンプル出版株式会社のホームページ
-
'@':
href: http://example.com/all.opds
type: application/atom+xml;profile=opds-catalog;kind=acquisition
rel: self
authors:
-
name: サンプル出版株式会社
email: [email protected]
uri: http://example.com/support
# 次行から始まるentries以下に書誌情報を列記します。
entries:
# OPDS Catalog Entry Documentの仕様に準拠するための必須要素のみで構成される最小限の書誌情報によるエントリーの例
# OPDS Catalog Entry Documentの使用については以下のURLを参照。
# http://opds-spec.org/specs/opds-catalog-1-1-20110627/#OPDS_Catalog_Entry_Documents
-
id: http://example.com/books/1
title: サンプル書籍1
updated: 2012-04-04T00:00:00Z
links:
-
'@':
href: http://example.com/books/1
type: text/html
rel: alternate
title: サンプル書籍1の紹介ページ
-
'@':
href: http://example.com/books/1.epub
type: application/epub+zip
rel: http://opds-spec.org/acquisition
# OPDS Catalog Entry Documentの仕様で「書くべき(SHOULD)」とされる要素で構成されたエントリーの例
-
id: http://example.com/books/2
title: サンプル書籍2
updated: 2012-04-04T00:00:00Z
links:
-
'@':
href: http://example.com/books/2
type: text/html
rel: alternate
title: サンプル書籍2の紹介ページ
-
'@':
href: http://example.com/books/2.epub
type: application/epub+zip
rel: http://opds-spec.org/acquisition
authors:
-
name: サンプル花子
email: [email protected]
uri: http://example.com/authors/hanako
-
name: サンプル太郎
email: [email protected]
uri: http://example.com/authors/taro
rights: Copyright (c) 2012, サンプル出版株式会社
dc:issued: 2012-04-04T00:00:00Z
identifiers:
- urn:isbn:978123456789
categories:
-
'@':
term: CLASSICS
scheme: http://example.com/categories
label: 古典
-
'@':
term: HUMOR
scheme: http://example.com/categories
label: ユーモア
summary: |
大臣の大饗は、さるべき所を申し請けて行ふ、常の事なり。宇治左大臣殿は、東三条殿にて行はる。内裏にてありけるを、申されけるによりて、他所へ行幸ありけり。させる事の寄せなけれども、女院の御所など借り申す、故実なりとぞ。
content:
'@':
type: text
'#': |
「喚子鳥は春のものなり」とばかり言ひて、如何なる鳥ともさだかに記せる物なし。或真言書の中に、喚子鳥鳴く時、招魂の法をば行ふ次第あり。これは鵺なり。万葉集の長歌に、「霞立つ、長き春日の」など続けたり。鵺鳥も喚子鳥のことざまに通いて聞ゆ。
# OPDS Catalog Entry Documentの仕様で「書いてもよい(MAY)」とされる要素も含むエントリーの例
-
id: http://example.com/books/3
title: サンプル書籍3
updated: 2012-04-04T00:00:00Z
links:
-
'@':
href: http://example.com/books/3
type: text/html
rel: alternate
title: サンプル書籍3の紹介ページ
-
'@':
href: http://example.com/books/3.epub
type: application/epub+zip
rel: http://opds-spec.org/acquisition
authors:
-
name: サンプル花子
email: [email protected]
uri: http://example.com/authors/hanako
-
name: サンプル太郎
email: [email protected]
uri: http://example.com/authors/taro
rights: Copyright (c) 2012, サンプル出版株式会社
dc:issued: 2012-04-04T00:00:00Z
identifiers:
- urn:isbn:978123456780
categories:
-
'@':
term: CLASSICS
scheme: http://example.com/categories
label: 古典
-
'@':
term: HUMOR
scheme: http://example.com/categories
label: ユーモア
summary: |
万の道の人、たとひ不堪なりといへども、堪能の非家の人に並ぶ時、必ず勝る事は、弛みなく慎みて軽々しくせぬと、偏へに自由なるとの等しからぬなり。
芸能・所作のみにあらず、大方の振舞・心遣ひも、愚かにして慎めるは、得の本なり。巧みにして欲しきまゝなるは、失の本なり。
content:
'@':
type: text
'#': |
人觝く牛をば角を截り、人喰ふ馬をば耳を截りて、その標とす。標を附けずして人を傷らせぬるは、主の咎なり。人喰ふ犬をば養ひ飼ふべからず。これ皆、咎あり。律の禁なり。
published: 2012-04-04T00:00:00Z
contributors:
-
name: 実例次郎
email: [email protected]
uri: http://example.com/authors/jiro
-
name: 実例三郎
email: [email protected]
uri: http://example.com/authors/saburo
# OPDS Catalog Entry Documentの仕様に記載されていないが、特に使用を禁じられていない要素を含むフィードの例。
# 現実世界の実際の出版社(O'reilly、Pragmatic Bookshelf、技術評論社等)のフィードを模した例。
# dc:publisher、dc:language、atom:subtitleが現実世界のフィードではしばしば使用されます。
# dc:publisherは、Catalog Entry Documentのみがフィードの作成者の手を離れて再配信された場合に出版社名を知りうるために重要で「書くべき」ものと考えます。
-
id: http://example.com/books/4
title: サンプル書籍4
updated: 2012-04-04T00:00:00Z
links:
-
'@':
href: http://example.com/books/4
type: text/html
rel: alternate
title: サンプル書籍4の紹介ページ
-
'@':
href: http://example.com/books/4.epub
type: application/epub+zip
rel: http://opds-spec.org/acquisition
-
'@':
href: http://example.com/books/4/cover.jpeg
type: image/jpeg
rel: http://opds-spec.org/image
-
'@':
href: http://example.com/books/4/thumbnail.jpeg
type: image/jpeg
rel: http://opds-spec.org/image/thumbnail
-
'@':
href: http://example.com/books/4/sample-book-4
type: text/html
rel: http://opds-spec.org/acquisition/buy
# opds:priceで複数の価格を設定することができます。例えば仕向地により異なる価格を設定する場合等。
# 実際はほとんど使用されていませんが、O'reillyの書誌に稀に見られます。
prices:
-
"opds:price":
'@':
currencycode: USD
'#':
18.00
-
opds:price:
'@':
currencycode: JPY
'#':
2000
authors:
-
name: サンプル花子
email: [email protected]
uri: http://example.com/authors/hanako
-
name: サンプル太郎
email: [email protected]
uri: http://example.com/authors/taro
rights: Copyright (c) 2012, サンプル出版株式会社
dc:issued: 2012-04-04T00:00:00Z
identifiers:
- urn:isbn:978123456781
categories:
-
'@':
term: CLASSICS
scheme: http://example.com/categories
label: 古典
-
'@':
term: HUMOR
scheme: http://example.com/categories
label: ユーモア
summary: |
或所の侍ども、内侍所の御神楽を見て、人に語るとて、「宝剣をばその人ぞ持ち給ひつる」など言ふを聞きて、内なる女房の中に、「別殿の行幸には、昼御座の御剣にてこそあれ」と忍びやかに言ひたりし、心にくかりき。その人、古き典侍なりけるとかや。
content:
'@':
type: text
'#': |
今日はその事をなさんと思へど、あらぬ急ぎ先づ出で来て紛れ暮し、待つ人は障りありて、頼めぬ人は来たり。頼みたる方の事は違ひて、思ひ寄らぬ道ばかりは叶ひぬ。煩はしかりつる事はことなくて、易かるべき事はいと心苦し。日々に過ぎ行くさま、予て思ひつるには似ず。一年の中もかくの如し。一生の間もしかなり。
予てのあらまし、皆違ひ行くかと思ふに、おのづから、違はぬ事もあれば、いよいよ、物は定め難し。不定と心得ぬるのみ、実にて違はず。
published: 2012-04-04T00:00:00Z
contributors:
-
name: 実例次郎
email: [email protected]
uri: http://example.com/authors/jiro
-
name: 実例三郎
email: [email protected]
uri: http://example.com/authors/saburo
subtitle: サンプル書籍4のサブタイトル
dc:publisher: サンプル出版株式会社
dc:language: ja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment