豚骨ラーメン(ネギ、味玉オプション)
口の中が未だネギ臭い。選択を誤ったか。
(Visited 2 times, 1 visits today)
PHPでRSSを生成する。
何らかのフィード(AtomかRSSか)を作りたいな。と思ったので、ライブラリを探してみた。
簡単に探して見つかったのが次のライブラリ。
RSS74 - Version 0.3
RSS74 is a PHP class with that you can create RSS files.
It provides a simple interface to do that. Just look at the examples. (2 examples included)
jonasjohn.de6 Users1 PocketError: 404 Not Foundhttp://jonasjohn.de/snippets/php_classes/
大分前にPHPSpotでも紹介されていまいしたね...。(ここ)
RSS2.0を生成することができます。
使い方はおそらく同梱されているサンプルを見ればおおよそ問題ないかと。
ライブラリのソースを眺めたのですが、そのまんま。でした。
あと、title, description要素とかに日本語を使うには、ライブラリ(inc.rss74.php)のhtmlentities関数をhtmlspecialchars関数に書き換える必要があることに注意。