Git Product home page Git Product logo

jianshu-api's Introduction

爬取简书中的文章保存至 MySQL 并生成 API

基于 python 2.7django 1.9

简书 API 测试地址 : http://222.24.63.118:8080/

1. 爬取前的准备

了解简书整个网站的结构以及分析网页源代码:

2. 爬取简书全站

爬取简书“新上榜”,“热门”中的文章并保存在 MySQL 中。

3. 爬取搜索到的文章

本来想爬取简书中某一类技术文章,由于简书没有明显的分类目录,文章也没有对应的 tag 所以准备爬取搜索到的文章。

对于搜索的文章只能爬取前 100 页,每页 10 条数据。

4. 生成 API

将上面爬取到的文章保存到 MySQL 中,使用 Django REST framework 来生成 API

简书 API

5. 部署上线

  • 使用 nginx + uwsgi + django + supervisor 进行环境部署

    或者

  • 使用 docker 进行环境部署

-_- 目前代码写的比较散乱,后面还会不断重构,如有任何建议,欢迎提 issue,欢迎 fork,pr,当然也别忘了 star 哦!


jianshu-api's People

Contributors

gosoon avatar strugglingyouth avatar

Watchers

 avatar  avatar

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.