2007年6月17日 星期日

使用PHP與AJAX製作RSS閱讀器

大家應該都有聽過RSS這東西吧!!
在臺灣常看到人用的閱讀器是YAHOO的和GOOGLE READER 現在就來學習如何在你的網站上加上RSS閱讀器吧!!!
< ? php // load the list of feeds require_once ('config.php'); ? >
< ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional // EN" "http: //www.w3.org/TR/xhtm11/DTD/xhtml1-transitional.dtd" >
< xmlns="http://www.w3.org/1999/xhtml">
<>
< equiv="content-type" content="text/html' charset=utf-8">
<> PHP 與 ajax RSS 閱讀器 < /title >
< rel="stylesheet" type= "text/css" href="rss_reader.css">
< src ="rss_reader.js" type ="text/javascript"> < /script >
< /head >
<>
<>PHP 與 ajax RSS 閱讀器 < / h1>
< id="feeds">
<> feeds < /h2>
< id ="feedlist ">
< ?php // display feeds for ($ =0; $i < id="feed-' .$i.'">< href="javascript" onclick = "getfeed(document.getelementbyid(\'feed-'.$i.'\'),\' ' .urlencode ( $feeds [$i]['feed']). '\');">';
echo $feeds[$i]['title'] .'< / a >< / li >';
}
? >
< /ul>
< / div>
< id ="content">
< id="loading" style="display:none"> loading feed ... < /div>
< id="feedcontainer" style ="display:none"> < /div>
< id="home">
<> about the rss reader < /h2 >
<>
這里是秀出首頁主視窗的文字
< /p >
< / div>
< /div >
< /body >
< / html >

這里的只是閱讀器的首頁程式,如果有興趣的人可以留言或寫信給我
我會在繼續發剩下的程式碼和整合教學