实时监控网站更新 [英] Monitoring website updates in realtime
问题描述
我很好奇如何实时监控网站的更新,最好是在 node.js 中.
I'm curious as how to monitor a website for it's updates in realtime, preferably in node.js.
让我们以维基百科为例.有人决定用一些相关信息更新一篇文章.我将如何订阅页面并立即在我的 node.js 服务器中获取事件,而不必每 X 秒轮询一次网站?
Let's take Wikipedia for example. Someone decides to update an article with some relevant information. How would I go about subscribing to the page and instantly getting the event in my node.js server without having to poll the website every X seconds?
推荐答案
通常,如果没有其他可能性(例如新闻提要),您将需要对网站进行投票.你不能强迫他们提供这样的服务.
In general, you will need to poll the website if there are no other possibilities like a news feed. You can't force them to provide such a service.
对于维基百科的详细信息,有实时更新 IRC 流,其中一个用于每个项目.Wikistream就是这样一个读取提要的应用,你可以在github上查看它的开源node.js代码.
For Wikipedia in detail, there are live update IRC streams, one for each project. Wikistream is such an app that reads the feed, you can view it's open source node.js code at github.
这篇关于实时监控网站更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!