zoukankan      html  css  js  c++  java
  • How to generate an RSS feed for your web site using ASP.NET

    How to generate an RSS feed for your web site using ASP.NET

     

    RSS stands for "Really Simple Syndication", is a standardized, XML-formatted means for syndication Web site content.

    Understand that RSS is intended to provide information about a Web site's latest content. For example, Yahoo! News provides RSS feeds of the latest news headlines, and TigerDirect.com provides RSS feeds of the feature items on the shopping site. Notice that RSS provides a synopsis for the recent articles or news items. It does not provide the complete content for all of the news items or articles.

     

    Let’s look at a demo RSS feed XML file: (Excerpted from the reference URL.)

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

    <rss version="2.0">

           <channel>

                  <title>uberASP.Net NewsWire</title>

                  <link>http://www.uberasp.net/newswire.aspx</link>

                  <description>The latest headlines and articles from the world of ASP.NET, Microsoft's Web development platform.</description>

                  <copyright>(c) 2004, POP World Media, LLC. All rights reserved.</copyright>

                  <ttl>5</ttl>

                  <item>

                         <title>Using HttpModules to send the right data format to the client</title>

                         <description>The same data might need to be presented in many different formats, including HTML, XML, rich text, or even

                         an Excel file. Through the use of HttpModules, your site will serve the right kind of data every time.</description>

                         <link>http://www.uberasp.net/GetArticle.aspx?id=15</link>

                         <pubDate>Mon, 12 Jan 2004 04:48:34 GMT</pubDate>

                  </item>

                  <item>

                         <title>Going solo and running your own consulting business: Is it for you?</title>

                         <description>Columnist explores the ups and downs of being your own boss.</description>

                         <link>http://www.uberasp.net/GetArticle.aspx?id=14</link>

                         <pubDate>Mon, 12 Jan 2004 03:48:35 GMT</pubDate>

                  </item>

                  <item>

                         <title>Use an HttpHandler to stop bandwidth leeching of your images</title>

                         <description>HttpHandlers make it easy to handle certain file types with a simple interface that anyone can write

                         code for.</description>

                         <link>http://www.uberasp.net/GetArticle.aspx?id=13</link>

                         <pubDate>Fri, 09 Jan 2004 06:14:21 GMT</pubDate>

                  </item>

           </channel>

    </rss>

     

    Brief introduction to RSS 2.0 speficiation:

    The root element of an RSS document is <rss>. It has precisely one child element, <channel>. The <channel> element contains information about the syndicated content, as well as information about each content item being syndicated. There are three required channel elements:

    l         <title> - provides a title for the channel.

    l         <link> - a URL to the channel.

    l         <description> - a short description of the channel.

    There are additional optional elements, such as <language>, <copyright>, <webMaster>, and others. For a complete list refer to the RSS 2.0 specification.

     

    The next important part of the spec is what you put in each item. The only thing required here is the title or description. We're using both, plus a link back to the article (because we want people to read the entire story, duh), and the pubDate element so the end-user can see how new the headline is.

    [The above content is excerpted from the reference URL.]

     

    ******

    The following two articles show you how to create an RSS syndication feed that adheres to the RSS 2.0 specification step by step.

    Reference URL:

    1. Building an RSS feed made simple, posted by Jeff

    http://www.uberasp.net/getarticle.aspx?id=17

     

    2. Syndicating Your Web Site's Content with RSS and ASP.NET, posted by Scott Mitchell

    http://aspnet.4guysfromrolla.com/articles/021804-1.aspx

     

     

     

  • 相关阅读:
    silverlight 跨域文件位置
    Asp.net弹出新窗口,获得返回值
    开通CNblog咯。
    访问IIS元数据库失败
    li可以显示多列
    [转]vs2005 sp1 下载地址、安装方法更新非常慢
    英特尔未来教育核心课程
    很好用的软键盘
    CMD里显示彩色文字
    将输入的中文按要求翻译成拼音
  • 原文地址:https://www.cnblogs.com/rickie/p/602216.html
Copyright © 2011-2022 走看看