2011-08-07 4 views
20

RSS 피드를 만들 필요가있는 웹 사이트가 있습니다. RSS 피드에 사용자 정의 필드를 추가하기위한 표준 형식이 있습니까? RSS 피드에 "location"요소를 추가하고 싶습니다. 피드를 사용하고 내 웹 사이트의 맞춤 입력란을 사용할 수있는 파트너가 있습니다. 나는 그들이 소비하고 분석 할 수 있도록 파트너이를 사용할 수 이상의 요소를 추가하고 싶었 어떤 경우더 많은 필드가있는 RSS 형식을 확장 하시겠습니까?

<?xml version="1.0" encoding="UTF-8" ?> 
<rss version="2.0"> 
    <channel> 
    <title>RSS Example</title> 
    <description>This is an example of an RSS feed</description> 
    <link>http://www.domain.com/link.htm</link> 
    <lastBuildDate>Mon, 28 Aug 2006 11:12:55 -0400 </lastBuildDate> 
    <pubDate>Tue, 29 Aug 2006 09:00:00 -0400</pubDate> 
    <language>en-us</language> 
    <copyright>Copyright 2002, Spartanburg Herald-Journal</copyright> 
    <managingEditor>[email protected] (George Matesky)</managingEditor> 
    <webMaster>[email protected] (Betty Guernsey)</webMaster> 
    <category>Newspapers</category> 
    <generator>MightyInHouse Content System v2.3</generator> 
    <docs>http://blogs.law.harvard.edu/tech/rss</docs> 
    <image> 
     <title>Something</title> 
     <url>http://something.com/image.jpg</url> 
     <link>http://something.com</link> 
     <description>This is something</description> 
    </image> 
    <rating>(PICS-1.1 "http://www.classify.org/safesurf/" l r (SS~~000 1))</rating> 
    <item> 
     <title>Item Example</title> 
     <description>This is an example of an Item</description> 
     <link>http://www.domain.com/link.htm</link> 
     <guid> 1102345</guid> 
     <pubDate>Tue, 29 Aug 2006 09:00:00 -0400</pubDate> 
     <author>[email protected] (Lawyer Boyer)</author> 
     <category>Grateful Dead</category> 
     <comments>http://www.myblog.org/cgi-local/mt/mt-comments.cgi?entry_id=290</comments> 
     <enclosure url="http://www.scripting.com/mp3s/weatherReportSuite.mp3" length="12216320" type="audio/mpeg" /> 
     <source url="http://www.tomalak.org/links2.xml">Tomalak's Realm</source> 
    </item> 
    </channel> 
</rss> 

: 현재 RSS 2.0 형식에 대한

, 이들은 RSS에서 사용할 수있는 포함 된 필드 2.0 사양은 그들이 원하는대로? 동시에 RSS 피드를 RSS 리더에 추가하면 RSS 리더를 중단하고 싶지 않습니다. 이 문제를 해결하는 가장 좋은 방법은 무엇입니까?

답변

24

다음 RSS 2.0 Specification에 따르면. 그것은 인기있는 포맷 된 후

"RSS는 1999 년에 시작된, 상대적으로 겸손한 목표, 형식을 이해 에 쉽고, 간단한로 노력하고있다 W3C에서 지정된대로, 개발자, 네임 스페이스에 정의 된 모듈을 사용하여 확장하고 싶었다.

는 RSS 2.0은 간단한 규칙 다음 그 기능을 추가합니다. RSS 피드가 가 describ을 요소를하지 포함 할 수 있습니다 이 요소는 요소가 네임 스페이스에 정의되어있을 때만 가능합니다. "

이 방법을 알려주는 Extending RSS 2.0 With Namespaces 문서를 확인하십시오. 이 기사의 한 예는 피드에 맞춤 블로그 필드를 추가하는 작성자를 보여줍니다.

<rss version="2.0" 
    xmlns="http://backend.userland.com/rss2" 
    xmlns:blogChannel="http://backend.userland.com/blogChannelModule"> 
<channel> 
    <title>Scripting News</title> 
    <link>http://www.scripting.com/</link> 
    <blogChannel:blogRoll>http://radio.weblogs.com/ ... /file.opml</blogChannel:blogRoll> 
    <blogChannel:mySubscriptions>http://ra ... /file.opml</blogChannel:mySubscriptions> 
    <blogChannel:blink>http://inessential.com/</blogChannel:blink> 
    . 
    . 
    . 
</channel> 
</rss> 
3

원하는 요소로 RSS 메시지를 확장 할 수 있으며 RSS 판독기에서 표준 요소와 확장을 구별하는 방법은 확장이 네임 스페이스에 있음을 의미합니다. 그렇게하면 표준 판독기가 표준 요소를 쉽게 읽고 확장을 무시할 수 있습니다.

http://cyber.law.harvard.edu/rss/rss.html#extendingRss

: 이러한 요소가 네임 스페이스에 정의 된 경우에만,이 페이지에 설명되지 않은 요소를 포함 할 수

RSS 피드.

관련 문제