• RSS规范 2010-07-09

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://androids-electricsheep.blogbus.com/logs/68652711.html

    Feed Validator地址

    http://validator.w3.org/feed/check.cgi?url=

     

    email地址

    item的author中email的正确格式如下

    Stanley@example.com (Stanley Wang)

    前面是email地址,后面括号中的是姓名

     

    日期格式

    错误提示:element must be an RFC-822 date-time

    pubDate,lastBuildDate中的日期必须是 RFC-822 date-time,正确格式如下

    Wed, 02 Oct 2002 13:00:00 GMT

    如果使用smarty的date_format,则参数为%a, %d %b %Y %H:%M:%S

    最后的GMT代表格林威治时间,中国的话可以替换为+0800

     

    MIME type

    如果是用php输出的rss的话,需要用header输出Content-Type

    RSS feeds 1.0 为 application/rdf+xml

    RSS feeds 2.0 为 application/rss+xml

    Atom feeds 为 application/atom+xml

     

    RSS本身的链接

    错误提示:

    Missing atom:link with rel="self"

    解决方法:

    首先要在rss标签中声明Atom的Namespace,如下:

    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

    在channel标签中应该加入带有rel="self"的atom:link标签,格式如下:

    <atom:link href="http://dallas.example.com/rss.xml" rel="self" type="application/rss+xml" />

     


    收藏到:Del.icio.us