Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev console导入代码fetch化 #66

Closed
esterTion opened this issue May 12, 2023 · 0 comments
Closed

dev console导入代码fetch化 #66

esterTion opened this issue May 12, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@esterTion
Copy link

感觉2023了还在$.ajax {async:false}有点不文明(x

((u,p)=>[0,1,2,3,4].reduce(async(promise, diff)=>{
  await promise
  var diffName = ['Basic', 'Advanced', 'Expert', 'Master', 'Re:Master'][diff]
  var url = 'https://maimai.wahlap.com/maimai-mobile/record/musicGenre/search/?genre=99&diff='+diff
  return fetch(url)
  .then(r => {if(r.url!=url)throw new Error(diffName+' 获取分数出错');return r.text()})
  .then(res => fetch('https://www.diving-fish.com/api/pageparser/page', {
    method: 'POST',
    headers:(new Headers({'Content-Type':'text/plain'})),
    body: "<login><u>"+u+"</u><p>"+p+"</p></login>" + res.match(/<html.*>([\s\S]*)<\/html>/)[1].replace(/\s+/g,' ')
  }))
  .then(r => r.json())
  .then(res => {console.log(diffName, res.message, res);if(res.message!='success')throw new Error(diffName+' 上传分数出错')})
}, Promise.resolve()))
("USERNAME", "PASSWORD");

当然我没有测过微信那个浏览器支不支持,按理说应该都可以了吧。
(我是自己做了抓net登录token地址扔给电脑,在电脑上上传的)

@Diving-Fish Diving-Fish added the enhancement New feature or request label May 18, 2023
Diving-Fish added a commit that referenced this issue May 18, 2023
Diving-Fish added a commit that referenced this issue May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants