腳本搶阿裏雲馬克杯?腳本大佬的腳本是怎麽寫的,來看一下
最近在搶“阿裏雲馬克杯”沒有腳本搶不到,現在有很多活動,數量有限需要搶,憑手動去搶很難搶到。有能力的大佬用腳本搶——快、準、狠
以前沒有接觸過這樣的腳本,現在記錄下來學習一下。
要自己寫腳本必須會一點點JavaScript,會查看網頁源代碼,寫腳本主要用到兩個函數,即setInterval() 方法和fetch()
setInterval() 方法 按照指定的周期(以毫秒計)來調用函數或計算表達式。
fetch()方法,簡單,合理的方式來跨網絡異步獲取資源。
通俗的講就是用fetch()方法提交表單,用setInterval() 方法控製什麽時候自動提交表單或者說在規定的時間內不停的提交表單。
這裏以搶“阿裏雲馬克杯”為例簡單的介紹腳本思路,下麵是網上收集的代碼,打開 https://developer.aliyun.com/adc/series/fc/登錄好,在59分58秒(“阿裏雲馬克杯”是晚上0點開始搶)的時候F12控製台 console裏麵粘貼回車就行。
//使用setInterval() 方法 按照指定的周期(以毫秒計)來調用函數或計算表達式 var times = 0; var cishu = setInterval(function(){ times++; if(times >= 30){ clearInterval(cishu);//執行30次後停止執行 } fetch("https://developer.aliyun.com/developer/api/award/receivePrize", { "headers": { "accept": "*/*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8", "cache-control": "no-cache", "content-type": "application/json", "pragma": "no-cache", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-requested-with": "XMLHttpRequest" }, "referrer": "https://developer.aliyun.com/adc/series/fc/", "referrerPolicy": "no-referrer-when-downgrade", "body": '{"mobile":"替換為手機號","awardId":"e7b816800c3f4ca9811eaaf3b6a29ccf","name":"替換為姓名","extension":"{ "address": "替換為收獲地址" }"}', "method": "POST", "mode": "cors", "credentials": "include" }); },200+Math.random()*100);
上麵的代碼裏的“200+Math.random()*100”表示會自動每200~300毫秒請求一次,
另外一個代碼,都一樣,隻是會在控製台輸出結果。
setInterval(function(){ fetch("https://developer.aliyun.com/developer/api/award/receivePrize", { "headers": { "accept": "*/*", "content-type": "application/json", "x-requested-with": "XMLHttpRequest" }, "referrerPolicy": "no-referrer-when-downgrade", "body": "{\"mobile\":\"13800000000\",\"awardId\":\"e7b816800c3f4ca9811eaaf3b6a29ccf\",\"name\":\"隔壁老王\",\"extension\":\"{ 'address': '地址' }\"}", "method": "POST", "mode": "cors", "credentials": "include" }).then(function(data) {console.log(data.json())}).then(function(Json) {console.log(Json);})},1000)
另外一個代碼,成功搶到會有紅色的輸出。失敗的都是灰色或者黑色輸出
setInterval(function() { var date = new Date(); var hour = date.getHours(); var minute = date.getMinutes(); var seconds = date.getSeconds(); //23:59:50開始 00:00:10停止 if ((hour === 23 && minute === 59 && seconds >= 50) || (hour === 0 && minute === 0 && seconds <= 10)) { fetch("https://developer.aliyun.com/developer/api/award/receivePrize", { "headers": { "accept": "*/*", "content-type": "application/json", "x-requested-with": "XMLHttpRequest" }, "referrerPolicy": "no-referrer-when-downgrade", "body": '{"mobile":"手機","awardId":"e7b816800c3f4ca9811eaaf3b6a29ccf","name":"姓名","extension":"{ 'address': '地址' }"}', "method": "POST", "mode": "cors", "credentials": "include" }).then(function(data) { return data.json(); }).then(function(res) { if (res.success && res.message.indexOf("成功") > -1) { //成功 console.error(res) } else { //失敗 console.log(res); } }) } }, 50 + Math.random() * 10);
相關說明:
1、VIP會員無限製任意下載,免積分。立即前往開通>>
2、下載積分可通過日常 簽到、綁定郵箱 以及 積分兌換 等途徑獲得!
3、本站資源大多存儲在雲盤,如出現鏈接失效請評論反饋,如有密碼,均為:www.ipipn.com。
4、所有站內資源僅供學習交流使用。未經原版權作者許可,禁止用於任何商業環境,否則後果自負。為尊重作者版權,請購買正版作品。
5、站內資源來源於網絡公開發表文件或網友分享,如侵犯您的權益,請聯係管理員處理。
6、本站提供的源碼、模板、軟件工具等其他資源,都不包含技術服務,請大家諒解!
7、源碼、模板等資源會隨著技術、壞境的升級而存在部分問題,還請慎重選擇。
PS.源碼均收集自網絡,如有侵犯閣下權益,請發信件至: admin@ipipn.com .
源站網 » 腳本搶阿裏雲馬克杯?腳本大佬的腳本是怎麽寫的,來看一下