Git Product home page Git Product logo

blog-crawler's Introduction

blog-crawler 通过给定的配置文件,爬取指定的博客文章。每次爬取都是博主最新的文章。类似于"订阅"。

tag 1.0.0 是命令行版本,命令行下运行blog-crawler,会把抓取到的文章信息输出到stdOut.

用法:

配置环境变量:BLOG_CRAWLER_CONF 指向一个配置文件,配置文件格式如下:

{
  "blogs": [{
      "address": "http://www.tracefact.net/",
      "author": "张子阳",
      "pageRule": "?page=1",
      "postStyle": "div.article",
      "titleStyle": "div.article .title a"
    },
    {
      "address": "https://www.zhangxinxu.com/wordpress/",
      "author": "张鑫旭",
      "pageRule": "wordpress/page/2/",
      "postStyle": "div.post",
      "titleStyle": "div.post h2 a",
      "timeStyle": "div.post .date"
    }]
}

字段说明:

  • address 博客地址
  • author 作者
  • pageRule 分页规则
  • postStyle 文章列表样式
  • titleStyle 博客标题样式
  • timeStyle 博客发表时间样式

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.