前の記事 ≪:マトリックス風GIFアニメを作成するWebツール
次の記事 ≫:AjaxでRSS/OPMLを読み込んでページに表示するツール

PHPからRSSを手軽に作成するライブラリ: RSSWriter

2006年02月06日-はてなブックマーク

スポンサード リンク
[PR] 英単語を忘却曲線アプリを使って超効率よく記憶する方法
RSSWriter

RSSWriter is a convenience class for generating RSS 1.0 feeds with PHP.

RSSWriterを使えば、RSSの詳しいフォーマットについて知らなくても、手軽にRSS1.0 feedを作成することが出来ます。
クラスの形式でライブラリ化されているので、自作のツールに組み込むのも容易です。

サンプルは次のような感じ。

<?php

include("rss10.inc");

$rss=new RSSWriter("http://www.example.org/",
                   
"Example Site"
                   
"The best examples out there."
                    array(
                        
"dc:publisher" => "Example Publishing Inc."
                        
"dc:creator" => "E X Ample <me@example.org>"
                         
)
);
        
$rss->setImage("http://www.example.org/images/rss.gif""Example Site: All the Examples Fit to Print"); 

$rss->addItem("http://www.example.org/page1.html""First Example Page");

$rss->addItem("http://www.example.org/page2.html""Second Example Page",
    array(
        
"description" => "This is the second page of examples on this wonderful site",
        
"dc:subject" => "examples",
        
"dc:creator" => "Fred <fred@example.org>"
         
)
);

$rss->serialize();

?>

関連の記事検索:PHP, RSS
スポンサード リンク

By.KJ : 2006年02月06日 15:03 livedoor Readerで購読 Twitterに投稿

間違いの指摘をしていただける方はメール、あるいはTwitter/FBでお願いします(クリック)