Coder Social home page Coder Social logo

alvin917 / vue-github-rank Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xnal/vue-github-rank

0.0 1.0 0.0 516 KB

Vue.js+Node.js爬虫,GitHub数据的爬取与展示。

Home Page: http://www.tdon.site/vue-github-rank/

License: MIT License

JavaScript 59.29% HTML 0.71% Vue 35.87% CSS 4.13%

vue-github-rank's Introduction

前言

之前使用Node.js开发一个小爬虫,算是初步对爬虫有了一定的了解,但爬取的数据没什么意义。最近使用GitHub的频率比较高,所以准备爬取一些GitHub的数据玩下。目前爬取了**区followers排名前100的大神,以及各个编程语言stars大于1000的开源项目。

源码

Talk is cheap. Show me the code.

访问地址

二维码

如何使用

git clone https://github.com/XNAL/vue-github-rank

// 需要先安装mysql,并创建数据库,可参考源码中的`github_rank.sql`

cd vue-github-rank
npm install

// 启动node服务
gulp nodemon 

// 本地运行需另开一个终端框口并执行以下命令,然后访问`http://localhost:8080/`
npm run dev

技术栈

  • Vue.js: 前端页面展示。
  • Axios: vue官方推荐HTTP库,请求后端数据。
  • 阿里巴巴的矢量图标库Iconfont: 页面图标,个人项目中使用起来比较方便。
  • Node.js + Koa2: 后台服务器搭架,(Koa2需要node v7.6以上)。
  • ES6/ES7: 后台开发以ES6语法为主,并使用了ES7中的async/await
  • Gulp: 后台服务器使用,自动化构建工具。
  • Webpack: Vue-cli自带的。需要配置本地代理proxyTable,以及配置SCSS的相关loader。
  • MySQL: 数据保存。
  • superagent: 比Node.js原生http模块更好用的客户端请求代理模块。
  • cheerio:服务端jQuery,分析网页内容。
  • node-schedule: Node.js定时执行模块。

说明

  1. 关于爬虫爬取数据的说明:目前是每2个小时去GitHub官网爬取数据,取到的数据会存入数据库中。在爬取的过程中可能会出现单个页面一直无法取到数据的情况,为避免程序一直卡在此步骤,目前是单个页面数据循环请求50次,如果仍取不到数据则跳过此项数据的爬取,等待下一次再进行爬取。

  2. 数据库字符集需要设置为utf8mb4,因为需要存取emoji表情。

项目截图

关于(首页)

关于(首页)

**区前100大神

**区前100大神

目录

目录

项目

项目

vue-github-rank's People

Contributors

xnal avatar

Watchers

 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.