อยากทำ rss แบบ pantip ครับ -..-

เริ่มโดย mikeyx, 17 พฤศจิกายน 2007, 09:22:31

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

mikeyx

พอจะมี code แบบ ไกล์ไลน์มั้ยครับ
หลักการผมเข้าใจว่า ดึงข้อมูลจาก ฐานข้อมูลมา
แล้วก็เขียนลงใน file xml

ผลที่ได้ก็จะเป็น http://yousite.com/name.xml
ผมเข้าไปดู ใน help ของ php แล้ว งงมาก ค้นหาใน google ก็แล้ว
ไม่มีครับ T_T ใครพอจะมีตัวอย่าง code ให้เอาไปแกะ ๆ งัด ๆแงะ ๆ บ้างครับ
ขอบคุณครับ

payu


ลองดูที่นี่ครับ rss 2.0 spec

http://www.rssboard.org/rss-specification
http://en.wikipedia.org/wiki/RSS_(file_format)


นี่ xml ตัวอย่างที่ gen ออกมา

<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Liftoff News</title>
      <link>http://liftoff.msfc.nasa.gov/</link>
      <description>Liftoff to Space Exploration.</description>
      <language>en-us</language>
      <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>

      <lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs>
      <generator>Weblog Editor 2.0</generator>
      <managingEditor>[email protected]</managingEditor>
      <webMaster>[email protected]</webMaster>
      <item>

         <title>Star City</title>
         <link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link>
         <description>How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia's &lt;a href="http://howe.iki.rssi.ru/GCTC/gctc_e.htm"&gt;Star City&lt;/a&gt;.</description>
         <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
         <guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>

      </item>
   </channel>
</rss>


หลักการก็แค่ไปอ่านข้อมูลจาก db แล้วก็ echo ออกมาให้ได้ output ตามตัวอย่างแค่นั้นเองครับ
[direct=http://www.facebook.com/iipayu]payu on facebook[/direct]

mikeyx