module
Version:
v0.0.0-...-cb4bbaf
Opens a new window with list of versions in this module.
Published: Mar 30, 2018
License: MIT
Opens a new window with license information.
README
¶
github-crawler
- 爬取
Github Trending数据,数据存储到Redis,在运行之前,请先设置 环境变量 RedisHost RedisPassword,如果不进行设置,则默认连接到 127.0.0.1:6379,Redis数据过期时间为2小时的基础上在加1小时的随机数,避免同一时刻大部分数据缓存过期
- 如何运行
-
首先下载本仓库,如果有安装Go 环境,则存放 到GOPATH/src目录下
-
源码运行
git clone https://github.com/king129/github-crawler.git $GOPATH/src/github-crawler
cd $GOPATH/src/github-crawler
go run app/main.go
-
可执行文件运行 (注意: 可执行文件只能在 macOS 平台运行)
// 每五分钟分钟执行60次任务 任务为 每个语言的 repo/developer daily weekly monthly 的数据
cd xxx/github-crawler/app
chmod +x app
./app
cd xxx/github-crawler/server
chmod +x server
./server
-
Docker 运行 需要安装 docker-compose
cd xxx/github-crawler
// 构建镜像
docker-compose build
// 启动相关镜像 可以添加 -d 参数 后台运行
docker-compose up
Directories
¶
Click to show internal directories.
Click to hide internal directories.