npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rss-worker

v1.0.2

Published

一个可配置的rss爬虫

Downloads

6

Readme

rss-worker

Build Status Coverage Status

简介

rss-worker是一个持久的可配的rss爬虫。支持多URL的并行爬取,并且会将所有条目按时间顺序进行保存,保存格式为"时间\n标题\n内容\n\n",支持的保存方式有fs与mongodb。

使用

安装

直接通过npm:

npm install rss-worker --save

源码:

git clone [email protected]:DavidCai1993/rss-worker.git
cd rss-worker && npm i && gulp #编译coffee的输出目录为./build

例子

var RssWorker = require('rss-worker');

var opt = {
  urls: ['https://cnodejs.org/rss', 'https://github.com/DavidCai1993.atom', 'http://segmentfault.com/feeds'],
  store: {
    type: 'fs',
    dist: './store/rss.txt'
  }
};

var rssWorker = new RssWorker(opt);
rssWorker.start();

一个抓取https://github.com/alsotang.atomhttps://cnodejs.org/rsshttp://segmentfault.com/feeds/blogs内容24小时的输出(2015/5/6 19:30至2015/5/7 19:30 ,地址是随手挑的...←_←):这里

API

new RssWorker(options)

生成一个RssWorker的实例

options:

  • urls(Array) - 必选,需要抓取的rss地址的数组
  • store(Object) - 存储方式,需要配置typedist两属性
    • type - 存储方式,可选fs(默认)或mongodb
    • dist - 存储结果的文件地址(将会自动创建),如:./store/rss.txt(fs),mongodb://localhost:27017/rss_worker(mongodb)
  • timeout(Number) - 每次抓取的间隔(秒),默认为60秒

start()

开始抓取

forceToEnd()

发出停止抓取信号,将不会继续抓取,但不会影响到正在进行的本次抓取。