// Any doctor with the title or description containing any exclude keyword will be excluded.
constexcludeKeywords=["自费",]// Any doctor with the title or description containing any include keyword will be included.
constincludeKeywords=["牙髓","牙体"]functionfilter(){consturl=$request.url// We only care about the schedule list.
if(!url.startsWith("https://mp.mhealth100.com/gateway/registration/appointment/schedule/find")){return}letbody=JSON.parse($response.body)// Make sure the response is valid.
if(body.resultCode!="0"){return}letfilteredData=[]body.data.forEach(s=>{// Any exclude keyword found, skip.
for(letkeywordofexcludeKeywords){if(s.doctorTitle.includes(keyword)||s.desc.includes(keyword)){return}}// Any include keyword found, keep.
for(letkeywordofincludeKeywords){if(s.doctorTitle.includes(keyword)||s.desc.includes(keyword)){filteredData.push(s)return}}})body.data=filteredData// Update the response.
$done({body:JSON.stringify(body)})}filter()
看到 disabled: e.disabled 就该知道怎么办了,暴力替换!直接把 e.disabled 改成 false 就行,强制启用同意按钮。有人会问,你怎么不去把 time 改成 0 ?不错,改 time 和加快倒计时的 setInterval 应当也行,不过既然 disabled 能直接改,我们不妨用最简单的方法。
在 Surge 的 Script 中实现一下,保存下面的脚本为文件:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
functionfuckDelay(){consturl=$request.urlif(!url.startsWith("https://mp.mhealth100.com/patient/registration/js/appointment-choise-doctor")){return}letbody=$response.body// Just enable the fucking button!
body=body?.replaceAll('e.disabled','false')$done({body})}fuckDelay()
#!/usr/bin/env node
process.env['NODE_TLS_REJECT_UNAUTHORIZED']=0;// Any doctor with the title or description containing any exclude keyword will be excluded.
constexcludeKeywords=["自费",]// Any doctor with the title or description containing any include keyword will be included.
constincludeKeywords=["牙髓","牙体"]// !!!!! FILL THIS AREA !!!!!
// Search for the APP called Bark on iOS App Store. Install it and paste the provided URL here.
constbarkUrl="https://api.day.app/XXXXXX"// !!!!! FILL THIS AREA !!!!!
// Copy the headers from the request made by the browser to the server.
// Note that you need to use the request that searches *all* schedules, i.e.,
// the request path should look like:
// /gateway/registration/appointment/schedule/find
constheader=`
GET /gateway/registration/appointment/schedule/find?branchCode=100238001&deptId=1100101&deptName=xxx&deptType=&startDate=2024-07-11&endDate=2024-07-17&ajaxConfig=true HTTP/2
:authority: mp.mhealth100.com
accept: application/json
sec-fetch-site: same-origin
cookie: xxx=1720681665
cookie: xxx=1720625377,1720661564,1720674293,1720681563
cookie: gray-active=false
cookie: providerId=wechat
cookie: token=xxx
cookie: userId=xxx
cookie: wechat_access_token=xxx
cookie: wechat_openId=xxx
cookie: HMACCOUNT=xxx
sec-fetch-dest: empty
accept-language: en-US,en;q=0.9
sec-fetch-mode: cors
user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.49(0x18003137) NetType/WIFI Language/zh_CN
referer: https://mp.mhealth100.com/patient/registration/
accept-encoding: gzip, deflate, br
`// parse headers into object
constheaders={}leturl="https://mp.mhealth100.com"header.split("\n").forEach(h=>{if(!h){return}if(h.startsWith("GET")){url+=h.split(" ")[1]return}if(h.startsWith(":")){return}let[key,value]=h.split(": ",2)if(!key||!value){return}key=key.trim()value=value.trim()if(headers[key]){headers[key]+="; "+valuereturn}headers[key]=value})console.log(url)console.log(headers)functionsendMessage(title,msg){if(barkUrl){fetch(`${barkUrl}/${encodeURIComponent(title)}/${encodeURIComponent(msg)}`).then(res=>res.text()).catch(error=>console.error('Error:',error));}}letfirstRun=trueasyncfunctionmain(){for(;;){if(firstRun){firstRun=false}else{console.log("Sleeping for 120 seconds")awaitnewPromise(r=>setTimeout(r,120_000))}try{constres=awaitfetch(url,{method:"GET",headers,}).then(res=>res.json()).catch(error=>{console.error('Error:',error)sendMessage("Error getting schedules",`${error}`)});if(res.resultCode!="0"){thrownewError(`Error getting schedules: ${res.resultDesc}`)}constschedules=res.dataconsole.log(`Total schedules: ${schedules.length}`)letfilteredSchedules=[]schedules.forEach(s=>{// Any exclude keyword found, skip.
for(letkeywordofexcludeKeywords){if(s.doctorTitle.includes(keyword)||s.desc.includes(keyword)){return}}// Any include keyword found, keep.
for(letkeywordofincludeKeywords){if(s.doctorTitle.includes(keyword)||s.desc.includes(keyword)){filteredSchedules.push(s)return}}})console.log(`Total filtered schedules: ${filteredSchedules.length}`)letavailableSchedules=[]letmsg=""filteredSchedules.forEach(s=>{constschedules=s.scheduleInfosschedules.forEach(schedule=>{if(+schedule.regLeaveCount>0){availableSchedules.push(s)console.log(s.doctorName,s.doctorTitle,schedule.regDate,schedule.weekName,schedule.shiftName)msg+=`${s.doctorName}${s.doctorTitle}${schedule.regDate}${schedule.weekName}${schedule.shiftName}\n`}})})if(availableSchedules.length>0&&msg.length>0){sendMessage("Available schedules",msg)}}catch(error){console.error('Error:',error)sendMessage("Error getting schedules",`${error}`)break}}}main()