MCPcopy Create free account
hub / github.com/ClydeTime/Surge / giveDynamicsLike

Function giveDynamicsLike

Script/Task/xmly.js:526–552  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

524}
525
526async function giveDynamicsLike(){
527 let headers = {
528 "Cookie": config.xm_cookie,
529 'Content-Type': `application/json`
530 }
531 let body = `{"feedId":217014623}`
532 let myRequest = {
533 url: `https://mobile.ximalaya.com/chaos/v2/feed/praise/create`,
534 headers: headers,
535 body: body
536 }
537 return await $.http.post(myRequest).then(
538 (response) => {
539 body = JSON.parse(response.body)
540 if (body.ret == 0) {
541 $.log("- 点赞动态成功")
542 return true
543 } else {
544 $.log("- !!!未知动态点赞状况")
545 return false
546 }
547 },(reason) => {
548 $.log("- !!!点赞动态失败")
549 return false
550 }
551 )
552}
553
554async function cancelDynamicsLike(){
555 let headers = {

Callers 1

mainFunction · 0.85

Calls 3

postMethod · 0.45
parseMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected