• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

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

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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

 

 

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Routing in ASP.NET Web API发布时间:2022-07-10
下一篇:
ASP.NETMVC4学习系统三(控制器Controller)发布时间:2022-07-10
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap