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

     

     

     

  • 相关阅读:
    《大数据之路:阿里巴巴大数据实践》——7-章 数据挖掘
    《如何做到毫秒级从百亿大表任意维度筛选数据?》
    《大数据之路:阿里巴巴大数据实践》——6-章 数据服务
    《【原创】推荐系统
    给机器学习面试者的十项建议 | 面试官角度
    干货 | NLP算法岗大厂面试经验与路线图分享
    目标检测任务中的训练宝典 |实用技巧
    食物图片变菜谱:这篇CVPR论文让人人都可以学习新料理
    一文彻底搞懂BP算法:原理推导+数据演示+项目实战(下篇)
    CVPR 2019细粒度图像分类竞赛中国团队DeepBlueAI获冠军 | 技术干货分享
  • 原文地址:https://www.cnblogs.com/rickie/p/602216.html
Copyright © 2011-2022 走看看