Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
Dec 23, 2018
lib
Feb 1, 2019
Feb 1, 2019
Oct 12, 2018
Dec 23, 2018
Oct 12, 2018
Feb 1, 2019

feeed

A simple tool to generate RSS feeds for any webpage, support puppeteer.

WARNING: still under development.

Installation

Make sure you have nodejs >= 7.6.0 and npm installed beforehand, then run

npm i -g feeed

Usage

first of all, create a sites.js like this:

module.exports = [
  {
    // cron time patterns for the job
    cron: '*/30 * * * *', // run the job every 30 minutes
    // target webpage
    link: 'https://movie.douban.com/cinema/nowplaying/hangzhou/',
    // limit of item number for RSS feeds
    limit: 30,
    // if you want to use puppeteer, please install it in your project
    usePuppeteer: false,
    // customize the way to get items
    process: ($) => {
      // use $ just like using jQuery
      const list = $('#nowplaying .lists > li');
      // should use an array as return value
      const res = [];
      list.each((index, item) => {
        const linkDOM = $(item).find('.stitle a');
        const title = linkDOM.attr('title');
        const link = linkDOM.attr('href');
        const scoreDOM = $(item).find('.srating .subject-rate');
        const score = scoreDOM.text() || '-';
        res.push({
          id: link, // required
          title, // required
          link, // required
          score,
        });
      });
      return res;
    },
  },
];

then run

feeed -c ./sites.js -d ./rss

it will create a RSS file for the site inside rss directory and regist a cron job based on your configure.

And check out available options with

feeed --help

About

A simple tool to generate RSS feeds for any webpage

Topics

Resources

Releases

No releases published

Packages

No packages published