admin管理员组

文章数量:1022670

I'm curious as how to monitor a website for it's updates in realtime, preferably in node.js.

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?

I'm curious as how to monitor a website for it's updates in realtime, preferably in node.js.

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?

Share Improve this question asked Jul 16, 2012 at 20:18 Ruben HomsRuben Homs 5911 gold badge7 silver badges21 bronze badges 4
  • I don't know enough about Node.js to do this, but someone who does could see how Hummingbird works and apply the same concepts. I think you'd need sockets. – Some Guy Commented Jul 16, 2012 at 20:21
  • 1 Make a deal with the Wikipedia people to post something to a web-based API you create whenever a page update is posted. – Pointy Commented Jul 16, 2012 at 20:21
  • 1 Think of it like stalking your ex. Either she tells you her news (highly unlikely) or you have to FETCH them. – Adi Commented Jul 16, 2012 at 20:22
  • I think you should have a look at pubsubhubbub – Alfred Commented Jul 17, 2012 at 5:06
Add a ment  | 

2 Answers 2

Reset to default 2

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.

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.

In case you have option to "instruct" the website to notify you, you can create webservice that website will call when it content is updated. But of course, that website should have such option.

I'm curious as how to monitor a website for it's updates in realtime, preferably in node.js.

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?

I'm curious as how to monitor a website for it's updates in realtime, preferably in node.js.

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?

Share Improve this question asked Jul 16, 2012 at 20:18 Ruben HomsRuben Homs 5911 gold badge7 silver badges21 bronze badges 4
  • I don't know enough about Node.js to do this, but someone who does could see how Hummingbird works and apply the same concepts. I think you'd need sockets. – Some Guy Commented Jul 16, 2012 at 20:21
  • 1 Make a deal with the Wikipedia people to post something to a web-based API you create whenever a page update is posted. – Pointy Commented Jul 16, 2012 at 20:21
  • 1 Think of it like stalking your ex. Either she tells you her news (highly unlikely) or you have to FETCH them. – Adi Commented Jul 16, 2012 at 20:22
  • I think you should have a look at pubsubhubbub – Alfred Commented Jul 17, 2012 at 5:06
Add a ment  | 

2 Answers 2

Reset to default 2

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.

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.

In case you have option to "instruct" the website to notify you, you can create webservice that website will call when it content is updated. But of course, that website should have such option.

本文标签: javascriptMonitoring website updates in realtimeStack Overflow