订阅 RSS 提要 [英] Subscribe to an RSS Feed

查看:72
本文介绍了订阅 RSS 提要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个非常简单的 RSS 阅读器 - 它需要做的就是获取 xml 文档,并将每个项目的标题和发布日期打印到控制台.我开始使用这两个问题:

I am writing a very simple RSS reader - all it needs to do is get the xml doc, and print to the console the title and publish date of every item. I got started using these two questions:

如何开始制作 C# RSS 阅读器?

阅读 Stack Overflow RSS 提要

我正在尝试弄清楚如何订阅,据我所知,您可以通过以下两种方式之一进行订阅.向提要站点发送 HTTP 请求,以便它在更新到来时推送您,或者每 X 秒轮询一次站点并简单地打印新的.

I'm trying to figure out how to subscribe, and as far as I can figure you do it one of two ways. Send an HTTP request to the feed site so it pushes you updates as they come, or poll the site every X seconds and simply print the new ones.

我发现很难相信由于在任何给定时刻都有数百万个 RSS 阅读器在运行,因此流行的 RSS 网站(如 facebook、twitter 或 myspace)每秒将被点击数亿次对所有订阅"它的 RSS 读者来说,这看起来像是 DOS 攻击.

I find it difficult the believe that there is no way to subscribe due to the millions of RSS readers running at any given moment, popular RSS sites like facebook, twitter, or myspace would be hit hundreds of millions of times per second due to all the RSS readers "subscribed" to it and look like a DOS attack.

那么订阅 RSS 提要的标准"方式是什么(如果确实存在这样的标准)?

So what is the "standard" way to subscribe to an RSS feed, if such a standard truely exists?

推荐答案

标准方式是轮询.不是每 x 秒,而是每 x 分钟或 x 小时.

The standard way is to poll. Not every x seconds but every x minutes or x hours.

RSS 背后的原因是让提要非常简单.可以向所有订阅者提供少量下载和相同的文件(易于在内存中缓存,并且无需处理开销来准确找出发送给每个客户端的内容和时间).

The reasoning behind RSS is to keep the feed extremely simple. Small download and the same file can be served to all subscribers (easy to cache in memory and no processing overhead to find out exactly what and when to send to each client).

这篇关于订阅 RSS 提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆