11// 赞赏:邀请码`A1040276307`
22// 链接`http://html34.qukantoutiao.net/qpr2/bBmQ.html?pid=5eb14518`
33// 农妇山泉 -> 有点咸
4-
5- const cookieName = '米读'
6- const readTimeurlKey = 'senku_readTimeurl_midu'
7- const readTimeheaderKey = 'senku_readTimeheader_midu'
4+ const cookieName = '米读阅读时长'
85const readTimebodyKey = 'senku_readTimebody_midu'
6+ const readTimeheaderKey = 'senku_readTimeheader_midu'
97const senku = init ( )
10- const readTimeurlVal = senku . getdata ( readTimeurlKey )
11- const readTimeheaderVal = senku . getdata ( readTimeheaderKey )
128const readTimebodyVal = senku . getdata ( readTimebodyKey )
9+ const readTimeheaderVal = senku . getdata ( readTimeheaderKey )
10+ const readTimeurlVal = 'https://apiwz.midukanshu.com/user/readTimeBase/readTime?' + readTimebodyVal
1311const signinfo = { }
14- let subTitle = ''
15- let detail = ''
1612 ; ( sign = async ( ) => {
1713 senku . log ( `🔔 ${ cookieName } ` )
1814 await readTime ( )
19- // showmsg()
2015 senku . done ( )
2116 } ) ( ) . catch ( ( e ) => senku . log ( `❌ ${ cookieName } 签到失败: ${ e } ` ) , senku . done ( ) )
2217
2318
19+ // 阅读时长
2420function readTime ( ) {
2521 return new Promise ( ( resolve , reject ) => {
26- const url = { url : readTimeurlVal , headers : readTimeheaderVal , body : readTimebodyVal }
22+ const url = { url : readTimeurlVal , headers : JSON . parse ( readTimeheaderVal ) }
2723 senku . post ( url , ( error , response , data ) => {
2824 try {
2925 senku . log ( `❕ ${ cookieName } readTime - response: ${ JSON . stringify ( response ) } ` )
3026 signinfo . readTime = JSON . parse ( data )
27+ let subTitle = ''
28+ let detail = ''
3129 if ( signinfo . readTime && signinfo . readTime . code == 0 ) {
3230 const coin = signinfo . readTime . data . coin
3331 const readTotalMinute = signinfo . readTime . data . readTotalMinute
3432 coin == 0 ? detail += `` : detail += `【阅读时长】获得${ coin } 💰`
35- if ( readTotalMinute % 40 == 0 ) {
36- detail += ` 阅读时长${ readTotalMinute / 2 } 分钟\n`
33+ if ( readTotalMinute % 20 == 0 ) {
34+ detail += ` 阅读时长${ readTotalMinute } 分钟\n`
3735 senku . msg ( cookieName , subTitle , detail )
3836 }
3937 } else if ( signinfo . readTime . code != 0 ) {
@@ -54,13 +52,6 @@ function readTime() {
5452 } )
5553}
5654
57- function showmsg ( ) {
58- subTitle += ''
59- detail += ''
60-
61- senku . msg ( cookieName , subTitle , detail )
62- senku . done ( )
63- }
6455
6556function init ( ) {
6657 isSurge = ( ) => {
@@ -104,4 +95,4 @@ function init() {
10495 $done ( value )
10596 }
10697 return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done }
107- }
98+ }
0 commit comments