• Stars
    star
    279
  • Rank 143,331 (Top 3 %)
  • Language
    JavaScript
  • Created over 10 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rss spider by nodejs , rss 爬虫,正文抓取

rssSpider

Design and coding with all the love in the world by ShaneLau.

The simplest way to use rssspide to fetch rss list and site info.
Fetch post'content ,give clean view to you.
rss 爬虫,快速抓取站点信息和文章列表,文章的正文抓取

This project is base on feedparser and node-readability

Usage

npm install rssspider

Then:

var spide = require('rssspider');
var url = 'http://www.bigertech.com/rss';
spide.fetchRss(url).then(function(data){
		console.log(data); // rss  post list
});

API Documentation

1. fetchRss(url,[options])

get rss site'post list ,like this www.bigertech.com/rss

  • url : webiste'rss url
  • options :what data you need ? default value:
	['title','description','summary','date','link','guid','author','comments','origlink','image','source','categories','enclosures']

response data Array

[{ title: '一个营销人员的自我修养',
  description: '<p></p>',
  summary: '</p>',
  date: Wed Oct 08 2014 17:14:26 GMT+0800 (CST),
  link: 'http://www.bigertech.com/learn-social-media-marketing/',
  guid: 'a623d78a-dae9-4915-9caa-0fd34fb3757c',
  author: '巴依老爷',
  comments: null,
  origlink: null,
  image: {},
  source: {},
  categories: [],
  enclosures: [] },
  ....  // more
	]

2. siteInfo(url,[options])

get website info

  • url webiste'rss url

  • options what data you need ? default value:

['title','description','date','link','xmlurl','author','favicon','copyright','generator','image']

```

response data Array

{ title: '笔戈科技',
description: '简单、有趣、有价值',
date: Thu Oct 09 2014 18:15:14 GMT+0800 (CST),
link: 'http://www.bigertech.com/',
xmlurl: 'http://www.bigertech.com/rss/',
author: null,
favicon: null,
copyright: null,
generator: 'Ghost 0.5',
image: {},
feedurl: 'http://www.bigertech.com/rss' }

** 以下功能在 1.2.0 才能使用, readability 的库支持不是很好 **

3. getCleanBody(url)

Turn any web page into a clean view. This module is based on arc90's readability project.

  • html url or html code.
  • options is an optional options object
  • callback is the callback to run - callback(error, article, meta)
var url = 'http://www.bigertech.com/learn-social-media-marketing/';
spide.getCleanBody(url).then(function(article){
      console.log(article.content);   //clean code view
  });
More info node-readability

article.content is clean view

The article content of the web page. Return false if failed.

4. getAllByUrl(url,[options])

This method is similar to fetchRss
####What'more ,it fetch the clean page content. Turn any web page into a clean view. This module is based on arc90's readability project.

  • url website'rss url

  • Array respose data

get clean view code , Clean view content


[{ title: '一个营销人员的自我修养',
   content:'clean code view',     // clean code view
  description: '<p></p>',
  summary: '</p>',
  date: Wed Oct 08 2014 17:14:26 GMT+0800 (CST),
  link: 'http://www.bigertech.com/learn-social-media-marketing/',
  guid: 'a623d78a-dae9-4915-9caa-0fd34fb3757c',
  author: '巴依老爷',
  comments: null,
  origlink: null,
  image: {},
  source: {},
  categories: [],
  enclosures: [] },
    ....... // more
	]

test 100%

nodeunit test/index.js

upgrade

Add node 4.x support

Any question shanelau

or
[email protected]

More Repositories

1

zhihu

项目没有维护了, fork 吧
JavaScript
935
star
2

weibo_comment

新浪微博的评论数据抓取和分析
JavaScript
89
star
3

sendcloud

NodeJS for sendcloud.sohu.com API
JavaScript
37
star
4

weixin-signature

微信获取签名,本地缓存签名
JavaScript
31
star
5

live-template

webStrom IDEA , live template example etc
21
star
6

node-interview-questions

nodejs 面试题精选、笔试题
20
star
7

NodeJs-Blog

Express 3.x搭建的MircoBlog博客系统源码,解决2.x诸多问题
JavaScript
8
star
8

newsServer

多站点新闻抓取,包括新闻正文和图片保存到本地。 新闻内容导入disczu, 自动发帖的实现
Java
3
star
9

dapp-truffle-react

DApp setup project.
JavaScript
2
star
10

ContentType

Get the MIME content-type for a filename.
JavaScript
2
star
11

neoway-obd

neoway 车载obd项目.NodeJs 和redis进行开发,使用socket
JavaScript
2
star
12

koa-url-cache

koa middleware. use koa cache res body
JavaScript
1
star
13

weixin-demo

微信开发
JavaScript
1
star
14

nostr-get-luck-account

Amazing Account for nostr
JavaScript
1
star
15

neoway

做一个有出息的程序员
Java
1
star
16

HNT_explorer

JavaScript
1
star
17

node-wenjuan

问卷网接入,第三方开发者接入,答题、问卷
JavaScript
1
star
18

short-url-alfred

A Alfred workflow for getting short URL
Shell
1
star
19

egg-mysql-demo

egg + sequelize + antd demo
JavaScript
1
star
20

baiduBCS

百度云存储实战,批量文件上传。实现静态网站的部署,可以直接看到网站发布的效果
Java
1
star
21

html5

个人 html 项目 html 模板
CSS
1
star
22

koa-file-server

文件服务器
JavaScript
1
star