今天刚放假回来,看见腾讯云推送了一个活动完成后赠送腾讯公仔一枚+腾讯定制文化衫一件,既然白拿咱也不能客气,拔光鹅毛!
活动地址https://mp.weixin.qq.com/s/_y7cuaTg0DOOpmYKc3puLw
废话不多说上教程,不喜勿喷!!!
准备工作
linux机器一台
电脑一台
B站账户一枚
腾讯云账户一枚
配置教程
1:安装命令行工具 Serverless Framework
连接ssh执行安装命令
curl -o- -L https://slss.io/install | bash
执行输出代表安装成功
[root@leeclassmate ~]# curl -o- -L https://slss.io/install | bash % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 178 100 178 0 0 187 0 --:--:-- --:--:-- --:--:-- 187 0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 100 3348 100 3348 0 0 1550 0 0:00:02 0:00:02 --:--:-- 15572 Installing Serverless! Downloading binary... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 123M 100 123M 0 0 12.5M 0 0:00:09 0:00:09 --:--:-- 14.0M Added the following to /root/.bashrc: # Added by serverless binary installer export PATH="$HOME/.serverless/bin:$PATH" Added the following to /root/.bash_profile: # Added by serverless binary installer export PATH="$HOME/.serverless/bin:$PATH" ┌─────────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Serverless Framework successfully installed! │ │ │ │ To start your first project, please open another terminal and run “serverless”. │ │ │ │ You can uninstall at anytime by running “serverless uninstall”. │ │ │ └─────────────────────────────────────────────────────────────────────────────────────┘ [root@leeclassmate ~]#
2:下载项目模版代码,并进入模版目录 biliexp-demo
ssh执行以下命令 断开之前进程再执行!!!
sls create --template-url https://github.com/happy888888/BiliExp.git cd BiliExp
输出以下结果代表成功
[root@leeclassmate ~]# sls create --template-url https://github.com/happy888888/BiliExp.git Serverless: Generating boilerplate... Serverless: Downloading and installing "BiliExp"... Serverless: Successfully installed "BiliExp" [root@leeclassmate ~]# cd BiliExp [root@leeclassmate BiliExp]#
3:打开 config/config.json
文档,根据说明填入对应内容,cookieDatas 由浏览器获取,email 处填入用于接受通知的邮件名 { “cookieDatas”:[ { “SESSDATA”: “”, “bili_jct”: “”, “DedeUserID”: “” } ], “email”: “” , }
登录B站账户获取cookies
获取 cookieDatas(以 Chrome 为例):登录 B 站 -> 右键点击「检查」-> application -> cookies
可能有些小伙伴们找不到application下面截图演示一下
复制DedeUserID,bili_jct,SESSDATA三个信息值填写上面教程文件即可
4:通过下列命令完成部署,部署成功后,每日可自动触发,完成一系列操作
sls deploy
想必你已经完成以上任务了
然后截图去领取奖励