Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

ukabuer/feeed

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published