SHARE
TWEET

Untitled

a guest Jan 11th, 2019 288 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var request = require('request');
  2. var mysql = require('mysql');
  3. var uid = "";
  4.  
  5. var con = mysql.createConnection({
  6.     host: "localhost",
  7.     user: "peter",
  8.     password: "xxx,
  9.     database: "mobiletest"
  10. });
  11.  
  12. con.connect(function(err) {
  13.         con.query("SELECT * FROM login_data where surname = ''", function (err, result, fields) {
  14.             result.forEach(function(row) {
  15.                 request({url: 'https://fortnite-public-api.theapinetwork.com/prod09/users/id?username='+row.name, json: true}, function(err, res, data) {
  16.                     if (err) throw err;
  17.                     if (data.errorMessage == "unknown_epic_user"){
  18.                         con.query("update login_data set surname = 'FAILED' where name = \?\;",[row.name], function (err, result, fields) {
  19.                         });
  20.                         return;
  21.                     }
  22.                     con.query("update login_data set surname = 'VALIDATED' where name = \?\;",[row.name], function (err, result, fields) {
  23.                         if (err) throw err;
  24.                     });
  25.                 });
  26.             });
  27.         });
  28. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top