const fetch = require ('node-fetch');
//GET COOKIE
const GetData = () => new Promise ((resolve, reject) => {
fetch ('https://topgoal.io/api/account/register/', {
method: 'GET',
})
.then (res => {
console.log(res);
resolve(res)
})
.catch(err => reject (err))
})
//DAFTAR AKUN
const Register = () => new Promise ((resolve, reject) => {
fetch('https://topgoal.io/api/account/register/', {
method: 'POST',
headers: {
'Host': 'topgoal.io',
'Cookie': '_ga=GA1.1.575180375.1652171281; _ga_YKMN4NVSL6=GS1.1.1652171281.1.1.1652171320.0',
'Content-Length': '78',
'Sec-Ch-Ua': '"(Not(A:Brand";v="8", "Chromium";v="101"',
'Sec-Ch-Ua-Mobile': '?0',
'Tz': 'Asia/Jakarta',
'Content-Type': 'application/json',
'Accept': 'application/json, text/plain, */*',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36',
'Lang': 'en-US',
'Sec-Ch-Ua-Platform': '"Windows"',
'Origin': 'https://topgoal.io',
'Sec-Fetch-Site': 'same-origin',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://topgoal.io/signup',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'en-US,en;q=0.9',
},
body: `email":"kyzunne49@gmail.com","passwd":"xxxx","inviterCode":"JH3LMQTQW"`
})
.then (res => res.text())
.then (res => {
resolve(res)
})
.catch (err => reject (err))
})
(async () => {
const cookies = await GetData()
console.log(cookies);
}) ()