Last active
December 23, 2022 06:40
-
-
Save khanhkhuu/51313e74decc4f9e96c6c1d16fc6bfd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cayDiemDataCamp() { | |
const cookie = '<YOUR_COOKIE_HERE>'; | |
for (let i = 0; i < 10000; i++) { | |
try { | |
spam(i, cookie); | |
} catch (err) {} | |
} | |
} | |
function spam(id, cookie) { | |
var options = { | |
'method': 'POST', | |
'hostname': 'campus-api.datacamp.com', | |
'path': '/api/exercises/submit', | |
'headers': { | |
'authority': 'campus-api.datacamp.com', | |
'accept': 'application/json', | |
'accept-language': 'vi-VN,vi;q=0.9,en-US;q=0.8,en;q=0.7,fr-FR;q=0.6,fr;q=0.5', | |
'content-type': 'application/json', | |
'cookie': cookie, | |
'origin': 'https://campus.datacamp.com', | |
'referer': 'https://campus.datacamp.com/', | |
'sec-ch-ua': '"Chromium";v="106", "Google Chrome";v="106", "Not;A=Brand";v="99"', | |
'sec-ch-ua-mobile': '?0', | |
'sec-ch-ua-platform': '"Windows"', | |
'sec-fetch-dest': 'empty', | |
'sec-fetch-mode': 'cors', | |
'sec-fetch-site': 'same-site', | |
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36', | |
'x-requested-with': 'XMLHttpRequest' | |
}, | |
'maxRedirects': 20 | |
}; | |
UrlFetchApp.fetch('https://campus-api.datacamp.com/api/exercises/submit', | |
{ ...options, | |
payload: JSON.stringify({"authentication_token":"t_o4Y1NyasWz4-qVvZJ_","correct":true,"id": 16000 + id,"xp":100,"timestamp":"2022-11-02T07:16:19.940Z"}) | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment