node.io

  • Owner: node-js-libs/node.io
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Note: this library is no longer maintained.

I wrote node.io in 2010 when node.js was still in its infancy and the npm repository didn't have the amazing choice of libraries as it does today.

Since it's now quite trivial to write your own scraper I've decided to stop maintaining the library.

Here's an example using request, cheerio and async.

var request = require('request')
  , cheerio = require('cheerio')
  , async = require('async')
  , format = require('util').format;

var reddits = [ 'programming', 'javascript', 'node' ]
  , concurrency = 2;

async.eachLimit(reddits, concurrency, function (reddit, next) {
    var url = format('http://reddit.com/r/%s', reddit);
    request(url, function (err, response, body) {
        if (err) throw err;
        var $ = cheerio.load(body);
        $('a.title').each(function () {
            console.log('%s (%s)', $(this).text(), $(this).attr('href'));
        });
        next();
    });
});

Happy scraping.

Main metrics

Overview
Name With Ownernode-js-libs/node.io
Primary LanguageJavaScript
Program languagePerl (Language Count: 4)
Platform
License:MIT License
所有者活动
Created At2010-11-03 08:53:10
Pushed At2015-11-18 03:22:35
Last Commit At2014-12-04 08:52:10
Release Count4
Last Release Name0.5.1 (Posted on )
First Release Name0.4.13 (Posted on )
用户参与
Stargazers Count1.8k
Watchers Count50
Fork Count140
Commits Count436
Has Issues Enabled
Issues Count138
Issue Open Count0
Pull Requests Count18
Pull Requests Open Count0
Pull Requests Close Count9
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private