这是一个定时爬取「趣运动」公众号羽毛球馆预定信息,将其推送至微信,并支持自动预定羽毛球场地的工具。
-
安装nodejs
前往nodejs官网下载对应最新稳定版本的
nodejs
-
设置npm镜像
npm config set registry https://registry.npm.taobao.org
-
下载代码
git clone https://github.com/marmot-z/yingsa2-spider.git cd yingsa2-spider/
-
配置文件
- 配置定时
cron
表达式用于设置爬虫工作频率(其与正常cron
表达式基本一致,只不过起最后一位不能使用?
,只能使用*
) - 设置手机号码(
user.phoneNum
)和密码(user.password
)用于登录 - 设置目需要预定的场地(
interested.sites
)和时间段(interested.startHour
/interested.endHour
) - 设置推送相关的应用
token
和用户uid
(详情请看push.md)
- 配置定时
-
构建 & 启动
npm install node ./index.js &
本工具只用来学习爬虫使用,仅供参考,不能用于其他用途。