欢迎来到好人卡资源网,专注网络技术资源收集,我们不仅是网络资源的搬运工,也生产原创资源。寻找资源请留言或关注公众号:烈日下的男人

术分享 傻瓜教程Serverless 实现 B 站打卡签到腾讯云函数部署教程

福利资讯 sky995 来源:LISHUO 4年前 (2020-10-01) 1671次浏览 0个评论

本文及资源最后更新时间 2020-10-01 by sky995

看见腾讯云推送了一个活动完成后赠送腾讯公仔一枚+腾讯定制文化衫一件,既然白拿咱也不能客气,拔光鹅毛!

活动地址https://mp.weixin.qq.com/s/_y7cuaTg0DOOpmYKc3puLw

术分享 傻瓜教程Serverless 实现 B 站打卡签到腾讯云函数部署教程

废话不多说上教程,不喜勿喷!!!

准备工作

linux机器一台

电脑一台

B站账户一枚

腾讯云账户一枚

配置教程

1:安装命令行工具 Serverless Framework
连接ssh执行安装命令

  1. curl o L https://slss.io/install | bash

执行输出代表安装成功

  1. [root@leeclassmate ~]# curl o L https://slss.io/install | bash
  2. % Total % Received % Xferd Average Speed Time Time Time Current
  3. Dload Upload Total Spent Left Speed
  4. 100 178 100 178 0 0 187 0 –:–:– –:–:– –:–:– 187
  5. 0 0 0 0 0 0 0 0 –:–:– 0:00:01 –:–:– 0
  6. 100 3348 100 3348 0 0 1550 0 0:00:02 0:00:02 –:–:– 15572
  7.  
  8. Installing Serverless!
  9.  
  10. Downloading binary
  11. % Total % Received % Xferd Average Speed Time Time Time Current
  12. Dload Upload Total Spent Left Speed
  13. 100 123M 100 123M 0 0 12.5M 0 0:00:09 0:00:09 –:–:– 14.0M
  14.  
  15. Added the following to /root/.bashrc:
  16.  
  17. # Added by serverless binary installer
  18. export PATH=“$HOME/.serverless/bin:$PATH”
  19.  
  20. Added the following to /root/.bash_profile:
  21.  
  22. # Added by serverless binary installer
  23. export PATH=“$HOME/.serverless/bin:$PATH”
  24.  
  25. ┌─────────────────────────────────────────────────────────────────────────────────────┐
  26. Serverless Framework successfully installed!
  27. To start your first project, please open another terminal and run serverless”.
  28. You can uninstall at anytime by running serverless uninstall”.
  29. └─────────────────────────────────────────────────────────────────────────────────────┘
  30.  
  31. [root@leeclassmate ~]#

2:下载项目模版代码,并进入模版目录 biliexp-demo

ssh执行以下命令 断开之前进程再执行!!!

  1. sls create templateurl https://github.com/happy888888/BiliExp.git
  2. cd BiliExp

输出以下结果代表成功

  1. [root@leeclassmate ~]# sls create templateurl https://github.com/happy888888/BiliExp.git
  2. Serverless: Generating boilerplate
  3. Serverless: Downloading and installing “BiliExp”
  4. Serverless: Successfully installed “BiliExp”
  5. [root@leeclassmate ~]# cd BiliExp
  6. [root@leeclassmate BiliExp]#

3:打开 config/config.json 文档,根据说明填入对应内容,cookieDatas 由浏览器获取,email 处填入用于接受通知的邮件名 { “cookieDatas”:[ { “SESSDATA”: “”, “bili_jct”: “”, “DedeUserID”: “” } ], “email”: “” , }

登录B站账户获取cookies

获取 cookieDatas(以 Chrome 为例):登录 B 站 -> 右键点击「检查」-> application -> cookies

可能有些小伙伴们找不到application下面截图演示一下

术分享 傻瓜教程Serverless 实现 B 站打卡签到腾讯云函数部署教程

复制DedeUserID,bili_jct,SESSDATA三个信息值填写上面教程文件即可

术分享 傻瓜教程Serverless 实现 B 站打卡签到腾讯云函数部署教程

4:通过下列命令完成部署,部署成功后,每日可自动触发,完成一系列操作

sls deploy
想必你已经完成以上任务了

然后截图去领取奖励


好人卡资源网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:术分享 傻瓜教程Serverless 实现 B 站打卡签到腾讯云函数部署教程
喜欢 (2)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址