File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77tieba.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
1111cron " 10 0 0 * *" script-path =https://raw.githubusercontent.com/chavyleung/scripts/master/tieba/tieba.js
1212```
1313
1414## 说明
1515
16161 . 先把` tieba.baidu.com ` 加到` [MITM] `
17172 . 再把两条远程脚本放到` [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 )
Original file line number Diff line number Diff line change 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
1212const cookieName = '百度贴吧'
1313const cookieKey = 'chavy_cookie_tieba'
14- let cookieVal = $request . headers [ 'Cookie' ]
14+ const cookieVal = $request . headers [ 'Cookie' ]
1515
1616if ( cookieVal ) {
1717 let cookie = $persistentStore . write ( cookieVal , cookieKey )
Original file line number Diff line number Diff line change 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}
You can’t perform that action at this time.
0 commit comments