`

What is RSS??

阅读更多

      RSS是站点用来和其他站点之间共享内容的一种简易方式(也叫聚合内容) 在门户网站大行其道,人们已经习惯通过搜索引擎来获取新闻资讯的今天,一种全新的资讯传播方式已经悄悄地来到我们身边,仔细观察一些网站,你可能注意到一些被标记为"XML"或"RSS"的橙色图标。 面对扑面而来的新闻,不用再花费大量的时间冲浪和从新闻网站下载,只要通过下载或购买一种小程序,这种技术被称为简易信息聚合(RSS:Really Simple Syndication)。

 

      RSS会收集和组织定制的新闻,按照你希望的格式、地点、时间和方式,直接传送到你的计算机上。新闻网站和那些在线日记作者已体会到了RSS提要带来的乐趣,这也使读者可以更容易跟踪RSS提要 RSS是一个缩写的英文术语,在英文中被认为有几个不同的源头,并被不同的技术团体做不同的解释。它既可以是"Rich Site Summary"(丰富站点摘要),或"RDF Site Summary"(RDF站点摘要),也可以是"Really Simple Syndication"(真正简易聚合)。

 

      现在已有的有Netscape, 1.0 (RSS-DEV版本),和 0.9x and 2.0 (UserLand Software版本) 0.9x和2.0。不过几乎所有能支持RSS的程序都可以浏览不同版本的RSS。 RSS是基于文本的格式。它是XML(可扩展标识语言)的一种形式。通常RSS文件都是标为XML,RSS files(通常也被称为RSS feeds或者channels)通常只包含简单的项目列表。一般而言,每一个项目都含有一个标题,一段简单的介绍,还有一个URL链接(比如是一个网页的地址)。其他的信息,例如日期,创建者的名字等等,都是可以选择的。 RSS是站点用来和其他站点之间共享内容的一种简易方式(也叫聚合内容),通常被用于新闻和其他按顺序排列的网站,例如Blog。一段项目的介绍可能包含新闻的全部介绍,Blog post等等。或者仅仅是额外的内容或者简短的介绍。这些项目的链接通常都能链接到全部的内容。网络用户可以在客户端借助于支持RSS的新闻聚合工具软件(例如NewzCrawler、FeedDemon),在不打开网站内容页面的情况下阅读支持RSS输出的网站内容。网站提供RSS输出,有利于让用户发现网站内容的更新。 RSS如何工作?首先您一般需要下载和安装一个RSS阅读器,然后从网站提供的聚合新闻目录列表中订阅您感兴趣的新闻栏目的内容。订阅后,您将会及时获得所订阅新闻频道的最新内容。 对于一般用户来说,用RSS订阅新闻可以像使用Outlook Express收取订阅的邮件一样简单;而对于Web应用程序的开发者而言,RSS的工作过程也不是那么复杂,至少比大多数其他常见的Web技术都更容易被理解和被实现。

 

      有人认为,RSS的初衷似乎是为了给邮件列表订阅服务以致命的打击,若从RSS的应用方式来看,这几乎是不可避免的。但从实际效果来看,RSS最火爆的应用并非是商业信息的集中订阅,而是个人通过Web实现的信息聚合,一个典型的例子就是各国的网志作者(Blogger)首先成为最普遍的RSS应用人群。

 

<?xml version="1.0" encoding="gb2312" ?>    
<rss version="2.0">    
<channel>    
  <title>我的Blog</title>                  //channel的标题   
  <description>与我自己的技术Blog相关联</description>    //channel的介绍   
  <link>http://counter.csdn.net/pv.aspx?id=72</link>      //channel的url   
  <item>    
  <title><!-- 项标题 --></title>            //item的标题   
  <link><!-- 项 URL --></link>            //item的url   
  <description><!-- 简要描述 --></description>         //item的介绍   
  <!-- 可选的/可扩展的元素 -->         //item的其他属性,比如更新时间   
  </item>    
  <item>   
  <!-- 可多个<item>项目-->            //一个channel有多个item   
  </item>   
</channel>   
</rss>  
 
RSS是两级结构,第一级结构是channel,相当于blog系统中某人的blog,第二级结构是item,相当于blog中的文章。属性中最重要的是title、description和link,title是标题,description是介绍,link是与其相关的url。

2.RSS的使用

        有的网站提供了RSS自动发现机制,可以很方便地把RSS的URL添加到RSS阅读器中。如果没有自动发现,那么可以手动把RSS链接的URL添加到RSS阅读器中,这样就加入了一个用户订阅的频道。在RSS阅读器中可以更新频道列表或点击一个item链接打开该item的页面。

3.RSS的工作机制

       
内容提供者在其网站上添加RSS的链接,以提供RSS订阅功能,当打开这个链接时,传送过去了一些频道信息,比如:blog的作者名。

        一种做法是,RSS链接URL指向的是一个空内容的页面,该页面后台程序通过传过来的频道信息访问数据库,获取频道列表,用Response.Write向该空页面写出XML格式的文件。

        另一种做法是,RSS链接URL指向的是一个xml文件,该文件由服务器的程序事先生成好的,放在服务器上,访问时静态获取,服务器在作者每添加一个频道列表时自动更新该xml文件。

        第一种做法的优点是管理方便,因为不需要为每个频道生成xml文件,所有的RSS请求都由一个后台页面处理,接口统一,但每次访问RSS链接时,都要动态地写出RSS频道列表,访问效率相对较低,第二种做法的优点是访问时,只是返回一个静态的xml文件,不需要访问数据库来临时生成,所以访问效率相对较高,但每更新一次频道列表中的项时,就要自动地重新生成xml文件以保证RSS文件的最新,这样就降低了更新的效率。
分享到:
评论

相关推荐

    Android代码-Munch

    What is Munch ? Munch is an android app which enable the users to manage their Rss feeds. User can add new sources, manage them and view the article associated with the feeds. Permissions: Internet ...

    Android SampleNetworking

    RssParser – is used to parse the results returned from the server into Data Objects. If we look at the responsibilities of the classes it’s clear where to break them up and delegate. Line numbers ...

    Professional Python Frameworks - Web 2.0 Programming with Django and TurboGears

    What Is MochiKit? 341 What’s Inside MochiKit? 341 MochiKit.Async 342 MochiKit.Base 349 MochiKit.DOM 351 MochiKit.Logging 352 MochiKit.Signal 352 MochiKit.Visual 355 MochiKit Miscellany 357 ...

    Professional Ajax

    The chapter-level breakdown is as follows: Chapter 1: "What Is Ajax?" This chapter explains the origins of Ajax and the technologies involved. It describes how Ajax developed as the ...

    Beginning Python (2005).pdf

    What Is a Schema/DTD? 278 What Are Document Models For? 278 Do You Need One? 278 Document Type Definitions 278 An Example DTD 278 DTDs Aren’t Exactly XML 280 Limitations of DTDs 280 Schemas ...

    wp-o-matic.1.0RC4.zip

    = What's the benefit of campaigns ? = Campaigns give you the ability to group feeds and select common options for them. So, if you ever decide to change a setting, all the feeds in that logical group...

    Oracle Concepts 中文英文对照版 (10g R2)

    Oracle Concepts 中文版 (10g R2) 订阅 RSS &lt;br&gt;-------------------------------------------------------------------------------- &lt;br&gt; Part I What Is Oracle? 第一部分 何为 Oracle? ...

    Learn Qt 5: with Qt, C++, and QML

    What you will learn Install and configure the Qt Framework and Qt Creator IDE Create a new multi-project solution from scratch and control every aspect of it with QMake Implement a rich user interface...

    Django 1.0 Website Development.pdf

    Adding RSS feeds 170 Creating the recent bookmarks feed 170 Customizing item fields 174 Creating the user bookmarks feed 175 Linking feeds to HTML pages 178 Advanced searching 179 Retrieving ...

    PHP Web 2.0 Mashup Projects.pdf

    Chapter 1 provides an overview of mashups: what a mashup is, and why you would want one. In Chapter 2 we create a basic mashup, and go shopping. We will simply look up products on Amazon....

    Learning Google Apps Script(PACKT,2016)

    Google Apps Script is a cloud-based scripting language based on ...Build Translator and RSS reader applications Develop interactive web pages Design interactive web-forms Form a workflow application

    PHP.and.MySQL.Recipes.A.Problem-Solution.Approach.1484206061

    ...What you hold in your hands is the answer to all your PHP 5 needs.... First, this book is a source of instant solutions, including countless pieces of useful code that you can just copy and paste into ...

    Practical Apache Struts2 Web 2.0 Projects

    Follow along with the introduction of important concepts and development techniques by way of a web site project closely resembling what you might encounter in any enterprise environment. What...

    Zend Framework 2 Application Development

    Filter and validate data no matter what the content is Handle and manage file uploads Gather content from other websites Fight spam with services such as Akismet Pull content from RSS feeds Quickly ...

    ComponentOne Studio for Windows Phone 2012 v3

    RichTextBox for Windows Phone is the only Windows Phone 7 control available which enables rich text editing in both RTF and HTML formats. You can also use the control to display blocks of rich content...

    Learning.Google.Apps.Script.1785882511

    Build Translator and RSS reader applications Develop interactive web pages Design interactive web-forms Form a workflow application About the Author Ramalingam Ganapathy is an independent computer ...

    DDKWizard 安装包及ddkbuild_cmd,ddkbuild_bat(用于DDK开发环境搭建)

    Instead of forcing you to use a subset of options and specific DDKs this wizard lets you choose what you want. Of course the template files are predefined and so is the content of the project(s) ...

    React.Native.Blueprints.epub

    React Native is a game-changing approach to hybrid mobile development. Our book will have a project based approach consisting of 7-8 projects that will help developers to achieve sound understanding...

Global site tag (gtag.js) - Google Analytics