node.io

  • 所有者: node-js-libs/node.io
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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.

主要指标

概览
名称与所有者node-js-libs/node.io
主编程语言JavaScript
编程语言Perl (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2010-11-03 08:53:10
推送于2015-11-18 03:22:35
最后一次提交2014-12-04 08:52:10
发布数4
最新版本名称0.5.1 (发布于 )
第一版名称0.4.13 (发布于 )
用户参与
星数1.8k
关注者数50
派生数140
提交数436
已启用问题?
问题数138
打开的问题数0
拉请求数18
打开的拉请求数0
关闭的拉请求数9
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?