forked from TheLastTech/SneakerBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
examplerun.js
79 lines (67 loc) · 2.02 KB
/
examplerun.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
let Profile = {
"CardNumber": "4859106276039681",
"Name": "Tom Anderson",
"Month": 5,
"Year": 2022,
"Cvv": "494",
"LastName": "Anderson",
"FirstName": "Tom",
"Address2": "",
"Address1": "312 Queen St East",
"State": "ON",
"City": "Toronto",
"Email": "[email protected]",
"Country": "Canada",
"Province": "On",
"PostalCode": "M5A1S8",
"Phone": "4172444137",
"SearchString": "Replicant",
"RequiredTerms": ["Replicant"],
"Size": "8",
"Threads": 3,
"AntiSearchTerms": ["red"],
"MaxPurchases": 1,
"Proxy": [{host: "104.140.209.20", port: 3128}]
};
let Site = new (require('./deadstock.ca'))("1", Profile);
Site.on('Message', console.log);
let TestSearch = async () => {
var SearchResults = await Site.Search(Profile.SearchString);
if (!SearchResults) {
console.log("Got No results at all");
return;
}
let Variant = await Site.ParseResults(SearchResults, Profile.RequiredTerms, Profile.Size, Profile.AntiSearchTerms);
if (!Variant) {
console.log("Got No results in size request");
Variant = await Site.ParseResults(SearchResults, Profile.RequiredTerms, Profile.Size, Profile.AntiSearchTerms, true);
if (!Variant) {
console.log("Got No results in wrong size request");
return;
}
}
let AddedResult = await Site.AddToCart(Variant.variant_id, 2);
if (!AddedResult) {
console.log("Got No on add to cart");
return;
}
let Token = await Site.GetPaymentCheckoutToken( );
if (!Token) {
console.log("Got No Token");
return;
}
let GetShippingResponse = await Site.GetShippingInfo();
let RedirectUrl = await Site.SendUserInfo( );
if (!RedirectUrl) {
console.log("Got No User SendUserInfo RedirectUrl");
return;
}
let CheckoutResponse = await Site.CheckOut(RedirectUrl,GetShippingResponse,Token)
{
}
return;
};
(async () => {
await TestSearch()
console.log('Finished');
})();