0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Webを支える技術] atom

Posted at

atomとは

RSSと同じく、Webサイトで使われる更新情報を記述するための文書フォーマット。
拡張子は.atom

requestで取得する際にはapplication/atom+xmlを指定します。

記述方法

atom
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xml:lang='ja'>
<title>blog.jxck.io</title>
<link rel="alternate" href="https://blog.jxck.io/"/>
<link rel="self" type="application/atom+xml" href="https://blog.jxck.io/feeds/atom.xml"/>
<author><name>Jxck</name></author>
<id>tag:blog.jxck.io,2016:feed</id>
<updated>2016-01-28T18:30:02Z</updated>
<entry>
 <title>AMP HTML 対応</title>
 <link href="https://blog.jxck.io/entries/2016-02-01/amp-html.html" rel="alternate" />
 <id>tag:blog.jxck.io,2016:entry://2016-02-01</id>
 <updated>2016-02-01T00:00:00Z</updated>
 <summary>Google が推奨する仕様である [AMP HTML](https://www.ampproject.org/) に、このブログを対応した。言いたいことは色々あるが、とりあえず非常に難しかったため、その対応方法や感想などを残す。</summary>
</entry>
</feed>

例引用: 一部改変

このように、HTML感覚で文書のメタデータやタイトルなどを記述できるxmlがatomです。
文書の書き方が決まっているため、RSSリーダーやブラウザで取得するときに便利です。また、独自のフォーマットを書くことができます。
atomでは、独自フォーマットは無視するという仕様があるため、RSSリーダーなどでは支障がなく、自分が使うときにはその独自フォーマットを読み込むことができます。

entry
<entry>
 <title>AMP HTML 対応</title>
 <link href="https://blog.jxck.io/entries/2016-02-01/amp-html.html" rel="alternate" />
 <id>tag:blog.jxck.io,2016:entry://2016-02-01</id>
 <updated>2016-02-01T00:00:00Z</updated>
 <summary>Google が推奨する仕様である [AMP HTML](https://www.ampproject.org/) に、このブログを対応した。言いたいことは色々あるが、とりあえず非常に難しかったため、その対応方法や感想などを残す。</summary>
</entry>

atom(RSS)では、タグの中にメタデータを書いていきます。この中に書いたものがRSSリーダーなどで表示されます。
atom(RSS)では、<title><id><updated><author>が必須要素となっています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?