Skip to content

Commit 5ef9e7c

Browse files
committed
更新[百度贴吧]签到脚本&说明
1 parent 251323d commit 5ef9e7c

3 files changed

Lines changed: 23 additions & 11 deletions

File tree

‎tieba/README.md‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,36 @@
77
tieba.baidu.com
88

99
[Script]
10-
http-request ^http://tieba.baidu.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.cookie.js
10+
http-request ^http:\/\/tieba\.baidu\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.cookie.js
1111
cron "10 0 0 * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.js
1212
```
1313

1414
## 说明
1515

1616
1. 先把`tieba.baidu.com`加到`[MITM]`
1717
2. 再把两条远程脚本放到`[Script]`
18-
3. 用浏览器访问下: http://tieba.baidu.com (需要登录)
19-
4. `Surge`提示: `Cookie [百度贴吧] 写入成功`
20-
5. 最后就可以把第 1 条脚本注释掉了
18+
3. 先用浏览器登录: https://tieba.baidu.com
19+
4. 再用浏览器访问一下: http://tieba.baidu.com (注意了, 是 http, 没有 s)
20+
5. `Surge`提示: `Cookie [百度贴吧] 写入成功`
21+
6. 最后就可以把第 1 条脚本注释掉了
2122

22-
> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了
23+
> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie.
2324
2425
> 第 2 条脚本是签到脚本, 每天`00:00:10`执行一次.
2526
27+
## 常见问题
28+
29+
1. 无法写入 Cookie
30+
31+
- 检查 Surge 系统通知权限放开了没
32+
- 如果你用的是 Safari, 请尝试在浏览地址栏`手动输入网址`(不要用复制粘贴)
33+
- 注意: 写入 Cookie 的网址是`http`开头的(不是 https, 没有 s, 没有 s, 没有要)
34+
35+
2. 写入 Cookie 成功, 但签到不成功
36+
37+
- 看看是不是在登录前就写入 Cookie 了
38+
- 如果是,请确保在登录成功后,再尝试写入 Cookie
39+
2640
## 感谢
2741

2842
[@NobyDa](https://github.com/NobyDa)

‎tieba/tieba.cookie.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
* tieba.baidu.com
55
*
66
* [Script]
7-
* http-request ^http://tieba.baidu.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.cookie.js
7+
* http-request ^http:\/\/tieba\.baidu\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.cookie.js
88
* cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.js
99
*
1010
*/
1111

1212
const cookieName = '百度贴吧'
1313
const cookieKey = 'chavy_cookie_tieba'
14-
let cookieVal = $request.headers['Cookie']
14+
const cookieVal = $request.headers['Cookie']
1515

1616
if (cookieVal) {
1717
let cookie = $persistentStore.write(cookieVal, cookieKey)

‎tieba/tieba.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* tieba.baidu.com
55
*
66
* [Script]
7-
* http-request ^http://tieba.baidu.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.cookie.js
7+
* http-request ^http:\/\/tieba\.baidu\.com script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.cookie.js
88
* cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.js
99
*
1010
*/
@@ -44,9 +44,7 @@ function signBar(bar) {
4444
if (result.no == 0) {
4545
console.log(`正在签到: ${bar[1]}, 签到成功`)
4646
} else {
47-
console.log(
48-
`正在签到: ${bar[1]}, 错误编码: ${result.no}, 错误原因: ${result.error}`
49-
)
47+
console.log(`正在签到: ${bar[1]}, 错误编码: ${result.no}, 错误原因: ${result.error}`)
5048
}
5149
})
5250
}

0 commit comments

Comments
 (0)