Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is node.js capable of reading from URL?

What I am trying to achieve is to create script which will read from URL and then use this data to do some manipulations.

In example. This script will run every 5 minutes, load page from somewhere, check if something changed, and if something did change (there is one small particular change I am actually will be looking for, but it doesn't matter, as the idea stays the same), it will send me an alert by email. Question is. Can Node.js handle that?

I can create this script in ruby, or even as shell script, run from crontab on server every N minutes; but I wanted to try out Node.js, and it sounds like I have a good "pet project" to try it on.

like image 464
alexeypro Avatar asked Feb 26 '11 00:02

alexeypro


1 Answers

Yes. look at the "request" module for node.js. It is basically an http client which you can use from inside your node.js app. See https://github.com/mikeal/request

like image 51
Nitin Avatar answered Oct 05 '22 04:10

Nitin