以下為本站文章分類清單

  1. AJAXspacer
  2. ASPspacer
  3. CSSspacer
  4. Javascriptspacer
  5. Windows 應用程式spacer
  6. 網頁設計
  7. 評論、短文、雜文spacer
  8. 版主spacer
  9. 最新回應spacer

以下為本頁本文內容

建立自己的 RSS

9/1 08' icon

RSS

幾個基本動作,簡單為自己的網站設計 RSS,開始吧!

步驟 1:XML 宣告

首先你要知道 RSS 本來就是一個標準 XML 格式,所以第一步,要進行 XML 宣告:

<?xml version="1.0" encoding="utf-8"?>

其中 encoding 雖是選項,但強烈建議一定要指定。

步驟 2:記錄 RSS 的三項必要資料

RSS Page

例如上圖,每一條 RSS 項目,基本上由「標題」、「連結」和「說明」組成,所以這三項就是每一條 RSS 基本項目,分別以「<title>」、「description」、「link」

<title>你被 AJAXed 了嗎?</title>
<description>如果你看到炫的畫面就是 AJAX 作的.....</description>
<link>http://audi.tw/Blog/AJAX/are-you-ajaxed.asp</link>

這樣就組成一個項目,為了明確區分這個項目,加上 <item> 宣告

<?xml version="1.0" encoding="utf-8"?>
<item>
      <title>你被 AJAXed 了嗎?</title>
      <description>如果你看到炫的畫面就是 AJAX </description>
      <link>http://audi.tw/Blog/AJAX/are-you-ajaxed.asp</link>
</item>

所以,有很多條 RSS 項目,就代表有很多組 <item></item>

步驟 3:宣告 RSS 頻道

RSS 是 XML 格式,但如果不進行特別的 RSS 宣告,還是沒法分辨,因此要加上 RSS 頻道宣告

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>

      <item>
            <title>你被 AJAXed 了嗎?</title>
            <description>如果你看到炫的畫面就是 AJAX </description>
            <link>http://audi.tw/Blog/AJAX/are-you-ajaxed.asp</link>
      </item>
</channel>
</rss>

步驟 4:為自己的 RSS 加上個人化資訊

RSS Info

RSS 發佈的欄目都設計好了,總要為自己的 RSS 取個名字,至少讓別人加入時,不會以「無名氏」的方式加入,這些基本資料至少有三項:「網站標題」、「網站描述」、「網站網址」,分別用「<title>」、「<description>」、「<link>」說明,這和記錄 RSS 內容相同,只不過不需要包含在 <item> 之中,就成為 RSS 的基本資料了。

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
      <title>【卜維丰】HTML / CSS / JavaScript</title>
      <description>【卜維丰】HTML / CSS / JavaScript</description>
      <link>http://audi.tw</link>

      <item>
            <title>你被 AJAXed 了嗎?</title>
            <description>如果你看到炫的畫面就是 AJAX </description>
            <link>http://audi.tw/Blog/AJAX/are-you-ajaxed.asp</link>
      </item>
</channel>
</rss>

步驟 5:存檔

這樣的內容,如果你是純文字,純手工編輯,就存成副檔名是 xml 即可,如 feed.xml,然後上傳到網站中。

步驟 6:驗證你的 RSS Feed

那到底這份 RSS 對不對呢?可以上網驗證一下,網址是:

http://feedvalidator.org/ 如果驗證沒問題,你會看到如下畫面!

[Valid RSS] 

步驟 7:在網站上加上訂閱連結

剩下,就是如何在自己網站上加上 RSS 訂閱的連結,連結網址就是你的 RSS xml 檔案來源,例如本站是 http://audi.tw/feed.xml ,當然,你可以選擇用文字超連結,也可以像我一樣使用圖示連結,那這裡,有超過 35 種不同 RSS 圖示供選擇,儘情選用吧!

Good Luck !

 

以下為文章回應區

同意轉載,不過麻煩看一下轉載需知

How do you prevent Achilles tendonitis?   2017/8/21 下午 06:36:00

Everything is very open with a very clear clarification of the challenges.
It was really informative. Your site is very useful.
Many thanks for sharing!

http://dixielandenberger.hatenablog.com   2017/8/12 下午 04:24:00

Nice post. I learn something new and challenging on sites I stumbleupon everyday.

It's always exciting to read articles from other writers and practice
a little something from their web sites.

What is the tendon at the back of your ankle?   2017/8/4 上午 10:00:00

I like the valuable information you provide in your articles.
I'll bookmark your blog and test again right here regularly.
I'm quite sure I will be informed many new stuff right right here!
Good luck for the following!

How you can increase your height?   2017/7/31 下午 12:17:00

Hello, always i used to check weblog posts here in the early hours in the break of day, as i love
to learn more and more.

marybellerafla.hatenablog.com   2017/7/31 上午 04:18:00

Hey there! Someone in my Myspace group shared this website with us so
I came to check it out. I'm definitely enjoying
the information. I'm book-marking and will be tweeting this
to my followers! Outstanding blog and outstanding design and style.

What causes the heels of your feet to burn?   2017/7/28 上午 11:05:00

Hello! I know this is kinda off topic however I'd figured I'd ask.
Would you be interested in trading links or maybe guest
authoring a blog post or vice-versa? My blog discusses a lot of the same
topics as yours and I think we could greatly benefit
from each other. If you happen to be interested feel free to send
me an e-mail. I look forward to hearing from you! Fantastic blog by
the way!

Can you grow taller with exercise?   2017/7/23 下午 03:49:00

I have to thank you for the efforts you've put in penning
this website. I really hope to see the same high-grade content from you later on as well.
In truth, your creative writing abilities has encouraged me to get my own site now ;)

ameblo.jp   2017/7/21 上午 07:37:00

Howdy! I know this is kind of off topic but I was wondering which blog platform are you using for this site?

I'm getting tired of Wordpress because I've had issues with hackers and
I'm looking at options for another platform. I would
be awesome if you could point me in the direction of a
good platform.

How do I stretch my Achilles tendon?   2017/7/16 下午 05:53:00

Hi friends, fastidious paragraph and fastidious arguments
commented at this place, I am really enjoying by these.

foot pain from bunion   2017/7/4 上午 01:54:00

Loving the info on this internet site, you have done outstanding job on the
content.

foot pain in the arch   2017/7/3 上午 10:06:00

Because the admin of this website is working, no question very rapidly it will be famous, due to its quality contents.

manicure   2017/5/4 上午 09:15:00

Good day! Would you mind if I share your blog with my zynga group?
There's a lot of folks that I think would really appreciate your content.

Please let me know. Cheers

manicure   2017/4/11 下午 06:51:00

Excellent web site you've got here.. It's hard to find good quality writing like yours nowadays.
I truly appreciate people like you! Take care!!

jude   2012/1/3 下午 08:06:00

你好:
我的網址如上,是wordpress作成的網站;用Safari瀏覽器可以看到我自己的feed。但http://feedvalidator.org/解析,網頁有錯誤。

(1)
我按feedvalidator建議,改用IE重建內容,但無效
(2)
wpfunction.php有修正,Fix RSS Feed修正,但沒有效果。
(3)
想燒 Feedbnrner,惟解析錯誤
想請教 audi 有無解決方式或方案。想讓網友訂閱 RSS

卜維丰   2010/3/27 上午 11:35:00

AWU, 你的 feed 可以寫成 asp,aspx,php 就是自動的了~^^

Awu   2010/3/13 下午 10:52:00

請問假如網站內新增文章XML會自動更新嗎?還是要手動更新?

LULU   2010/3/7 下午 05:59:00

感謝分享哦~ ^^



noname   2009/12/22 下午 01:40:00

非常感謝,你寫的十分詳細。

阿宏   2009/11/18 下午 05:21:00

我想請問一下,如果別人訂閱,我本站更新他也會更新嗎?想請教更深一步的原理,請加我msn
ahung2006 at hotmail.com

amy   2009/6/16 下午 10:36:00

感謝分享哦~ 有機會來試試看...^^

Rafael   2009/5/1 上午 01:07:00

Nice Tutorial! Thanks you!

Marie   2008/12/25 上午 11:43:00

這是很有用的教學,感謝分享,將來我可以用上場了~~

給個回應
姓名:
佈落格網址:
  如果您是要發問問題, 最好有個問題測試的網址, 這樣比較容易找到您問題所在, 謝謝
內容: