フィード
「フィード」は、ブログやサイトの更新情報を通知するためのデータです。ブログやサイトからフィードが提供されていると、ブログやサイトの読者は「フィードリーダー」と呼ばれるソフトウェアにフィードのURL(アドレス)を登録することができ、新しい投稿が公開されたときに投稿をすぐにチェックすることができるようになります。
※ フィードリーダー(Feedly)の例。フィードは複数登録でき、利用者は好きなブログやサイトに頻繁にアクセスしなくても新着情報を見逃さずにチェックすることができるようになります。
※ WordPress管理画面のダッシュボードにある「WordPressニュース」も、フィードデータを利用して表示されています。
フィードのアイコン
フィードを提供していることをアピールしたい場合は、下記のようなアイコンとともにフィードのURLのリンクを設置することがあります。(下記は 「フィードアイコンガイドライン」にもとづいて使用できるフリーなアイコンですが、これに似たアイコンを自作して使用することもあります)
フィードの形式
フィードの形式は主に「RSS」または「Atom」と呼ばれるフォーマット(ファイル形式)が使用されます。どちらもXMLをベースにしたタグ付きテキストの形式ですが、タグの意味合いなどが異なっています。
RSS (2.0) の例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" > <channel> <title>テストサイト</title> <atom:link href="http://example.com/feed/" rel="self" type="application/rss+xml" /> <link>http://example.com</link> <description>Just another WordPress site</description> <lastBuildDate>Fri, 12 Aug 2016 11:33:22 +0000</lastBuildDate> <language>ja</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=4.5.3</generator> <item> <title>Hello world!</title> <link>http://example.com/2016/07/31/hello-world/</link> <comments>http://example.com/2016/07/31/hello-world/#comments</comments> <pubDate>Sat, 30 Jul 2016 15:00:17 +0000</pubDate> <dc:creator><![CDATA[管理者]]></dc:creator> <category><![CDATA[未分類]]></category> <guid isPermaLink="false">http://example.com?p=1</guid> <description><![CDATA[テスト抜粋]]></description> <content:encoded><![CDATA[<p>WordPress へようこそ。これは最初の投稿です。編集もしくは削除してブログを始めてください !</p>]]></content:encoded> <wfw:commentRss>http://example.com/2016/07/31/hello-world/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss> |
Atom の例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="ja" xml:base="http://example.com/wp-atom.php" > <title type="text">テストサイト</title> <subtitle type="text">Just another WordPress site</subtitle> <updated>2016-08-12T11:33:22Z</updated> <link rel="alternate" type="text/html" href="http://example.com" /> <id>http://example.com/feed/atom/</id> <link rel="self" type="application/atom+xml" href="http://example.com/feed/atom/" /> <generator uri="https://wordpress.org/" version="4.5.3">WordPress</generator> <entry> <author> <name>管理者</name> </author> <title type="html"><![CDATA[Hello world!]]></title> <link rel="alternate" type="text/html" href="http://example.com/2016/07/31/hello-world/" /> <id>http://example.com?p=1</id> <updated>2016-07-31T15:02:10Z</updated> <published>2016-07-30T15:00:17Z</published> <category scheme="http://example.com" term="未分類" /> <summary type="html"><![CDATA[テスト抜粋]]></summary> <content type="html" xml:base="http://example.com/2016/07/31/hello-world/"><![CDATA[<p>WordPress へようこそ。これは最初の投稿です。編集もしくは削除してブログを始めてください !</p>]]></content> <link rel="replies" type="text/html" href="http://example.com/2016/07/31/hello-world/#comments" thr:count="1"/> <link rel="replies" type="application/atom+xml" href="http://example.com/2016/07/31/hello-world/feed/atom/" thr:count="1"/> <thr:total>1</thr:total> </entry> </feed> |
WordPressでのフィード
WordPressでは、何も設定をしなくても標準でRSSとAtom形式のフィードが提供されるようになっています。(投稿ページなどをブラウザで表示してからページのソースを表示すると、下記のようなタグが挿入されていると思います)
1 2 3 |
<link rel="alternate" type="application/rss+xml" title="○○サイト » フィード" href="http://example.com/feed" /> <link rel="alternate" type="application/rss+xml" title="○○サイト » コメントフィード" href="http://example.com/comments/feed" /> <link rel="alternate" type="application/rss+xml" title="○○サイト » ○○記事 のコメントのフィード" href="http://example.com/XXXX/feed" /> |