kyuurzy

Send To NGL

Dec 18th, 2025
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.58 KB | Source Code | 0 0
  1. // ngl.js
  2. const fetch = require("node-fetch")
  3.  
  4. async function submitToNGL(username, question) {
  5.     const url = 'https://ngl.link/api/submit';
  6.    
  7.     const data = {
  8.         username: username,
  9.         question: question,
  10.         deviceId: 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
  11.             const r = Math.random() * 16 | 0;
  12.             const v = c == 'x' ? r : (r & 0x3 | 0x8);
  13.             return v.toString(16);
  14.         }),
  15.         gameSlug: '',
  16.         referrer: ''
  17.     };
  18.     const formData = new URLSearchParams();
  19.     for (const key in data) {
  20.         formData.append(key, data[key]);
  21.     }
  22.     const headers = {
  23.         'Host': 'ngl.link',
  24.         'sec-ch-ua': '"Chromium";v="139", "Not;A=Brand";v="99"',
  25.         'accept': '*/*',
  26.         'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
  27.         'x-requested-with': 'XMLHttpRequest',
  28.         'sec-ch-ua-mobile': '?1',
  29.         'user-agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Mobile Safari/537.36',
  30.         'sec-ch-ua-platform': '"Android"',
  31.         'origin': 'https://ngl.link',
  32.         'sec-fetch-site': 'same-origin',
  33.         'sec-fetch-mode': 'cors',
  34.         'sec-fetch-dest': 'empty',
  35.         'referer': `https://ngl.link/${username}`,
  36.         'accept-encoding': 'gzip, deflate, br',
  37.         'accept-language': 'id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7'
  38.     };
  39.     const response = await fetch(url, {
  40.         method: 'POST',
  41.         headers: headers,
  42.         body: formData.toString()
  43.     });
  44.     return response;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment