Skip to content

Latest commit

 

History

History
115 lines (83 loc) · 3.01 KB

README.md

File metadata and controls

115 lines (83 loc) · 3.01 KB

feedit-pro


build status Test coverage node version

help to subscribe the tech blog you want

Watch Yuque

Welcome watch my Yuque column and keep getting the latest knowledge.

Features

  • IM Robot push
  • Translate English to Chinese automatically

Dingtalk Bot

Setup

Nginx configuration

server {
  listen 80;
  location /feedit-pro/ {
    autoindex on;
    autoindex_localtime on;
    index index.htm index.html;
    root /usr/share/nginx/html;
  }
}

Start feedit-pro

item type description
WEBHOOK_URL string robot url of the dingtalk group
BASE_URL string base url of your website
FEEDIT_ROOT_DIR string root directory of archive posts, default: $HOME
YUQUE_PRIVATE_TOKEN string private token for Yuque
$ git clone https://github.com/feedit/feedit-pro.git
$ npm i
# start feedit service
$ npm run start

Add rules

rules is located in config/rules

// for example
module.exports = {
  enable: true,
  run: async function() {
    const url = 'https://medium.com/feed/netflix-techblog';
    const siteId = path.basename(__filename).replace('.js', '');

    const res = await this.ctx.requestXML(url);
    const first = res.rss.channel.item[0];
    first.siteId = siteId;
    first.title = first.title.$cd;
    first.logoUrl = 'https://feedit.github.io/feedit-pro/app/public/images/netflix.jpg';

    if (this.ctx.isExisted(first)) {
      return;
    }

    const content = first.content$encoded.$cd;
    let $ = cheerio.load(content);
    $ = await this.ctx.translateNode($);
    await this.ctx.archiveToDir($, first);
  },
};

Development

$ DEBUG_MODE=true node ./app/schedule/visitor.js
$ npm run start:local

Contributors


xudafeng


ltianqi

This project follows the git-contributor spec, auto upated at Sun Dec 23 2018 23:28:09 GMT+0800.