Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ngl.js
- const fetch = require("node-fetch")
- async function submitToNGL(username, question) {
- const url = 'https://ngl.link/api/submit';
- const data = {
- username: username,
- question: question,
- deviceId: 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
- const r = Math.random() * 16 | 0;
- const v = c == 'x' ? r : (r & 0x3 | 0x8);
- return v.toString(16);
- }),
- gameSlug: '',
- referrer: ''
- };
- const formData = new URLSearchParams();
- for (const key in data) {
- formData.append(key, data[key]);
- }
- const headers = {
- 'Host': 'ngl.link',
- 'sec-ch-ua': '"Chromium";v="139", "Not;A=Brand";v="99"',
- 'accept': '*/*',
- 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
- 'x-requested-with': 'XMLHttpRequest',
- 'sec-ch-ua-mobile': '?1',
- 'user-agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Mobile Safari/537.36',
- 'sec-ch-ua-platform': '"Android"',
- 'origin': 'https://ngl.link',
- 'sec-fetch-site': 'same-origin',
- 'sec-fetch-mode': 'cors',
- 'sec-fetch-dest': 'empty',
- 'referer': `https://ngl.link/${username}`,
- 'accept-encoding': 'gzip, deflate, br',
- 'accept-language': 'id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7'
- };
- const response = await fetch(url, {
- method: 'POST',
- headers: headers,
- body: formData.toString()
- });
- return response;
- }
Advertisement
Add Comment
Please, Sign In to add comment