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&qu开发者_运维问答ot; to try it on.
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
精彩评论