はてなブックマークのエクスポート
http://b.hatena.ne.jp/help/entry/port#export に従う。
- ユーザー画面から設定画面に
- 「データ管理」タブに移動します
- エクスポートより、Atomフォーマットを選んで、右クリックでダウンロード。
何も変更しないと、ダウンロードのファイル名はdump.htmとなる。実際には、dump.htmにAtomフィードのXML形式で入っている。
<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://purl.org/atom/ns#" xml:lang="ja" xmlns:opensearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" >
1エントリーは、
<entry> <id>tag:hatena.ne.jp,2005:bookmark-m-hiyama-351108256</id> <title>125.html</title> <link type="text/html" rel="related" href="https://yamasakimasaki.com/blog/125.html"/> <link type="text/html" rel="alternate" href="http://b.hatena.ne.jp/m-hiyama/20171206#bookmark-351108256"/> <link type="application/x.atom+xml" rel="service.edit" title="125.html" href="http://b.hatena.ne.jp/atom/edit/351108256"/> <summary> マストドンAPIの解説</summary> <issued>2017-12-06T15:52:16+09:00</issued> <author> <name>m-hiyama</name> </author> <dc:subject>mastodon</dc:subject> <dc:subject>webapi</dc:subject> </entry>
- id: tag URIが使われている。一意性が保証できるばなんでもいい。
- title: おそらく、ターゲットページのtitleタグから取得している。
- link related: ターゲットURIがここに入っている。
- link alternte: ブックマークエントリー自体のURLが入っている。
- link sevice.edit: このエントリーを編集するときのURLだと思うが、詳細は不明。
- summary: ブックマークユーザーが入れたコメント文言。
- issued: ブックマークエントリーが生成された日時、どっちかいうとcreatedだと思う。
- author: ブックマークユーザー、エントリーの生成者。
- dc:subject: タグが並ぶ
faviconの画像URLなどは入ってないので、表示のときに取ってきてるのだろう。また、ターゲットベージのサマリー(ブックマークのコメントではない)もその場で取ってきているようだ。
WebAnnotation(https://www.w3.org/TR/annotation-model/)と比較してみる。
WebAnnotation | はてな |
---|---|
id | id |
type | なし |
target | link related |
body | 適当にラップすればいい |
body/value | summary |
body/created | issued |
body/creator | author |
body/id | link alternative |
? | title |
? | dc:subject |
一番大事なタイトルとタグが対応付けできない。WebAnnotationは拡張できるから別にいいけど。
その場で取得や生成している項目