-
Notifications
You must be signed in to change notification settings - Fork 13
/
MonitorLink.cs
827 lines (802 loc) · 23 KB
/
MonitorLink.cs
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Xml;
using CsQuery;
using IMLokesh.Extensions;
using IMLokesh.HttpUtility;
using Jint;
using Jint.Native;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Better_Nike_Bot
{
// Token: 0x0200003B RID: 59
public class MonitorLink
{
// Token: 0x06000298 RID: 664 RVA: 0x0002AA38 File Offset: 0x00028C38
public MonitorLink(string link, IEnumerable<Account> ndcAccounts)
{
if (!link.Contains("/pw/n/1j7?sl="))
{
if (Form1.MonitorLinks.Any((MonitorLink l) => !l.Link.IsNullOrEmpty() && MonitorLink.RemoveQueryString(l.Link) == MonitorLink.RemoveQueryString(link)))
{
Form1.MonitorLinks.Remove(this);
Logger.Log("Link {0} has already been processed...".With(new object[]
{
link
}), true, true);
return;
}
}
this.Link = (link.IsNikeUrl() ? link : HttpHelper.GetRedirectUrl(link, Form1.ProxyEnumeration.GetNextObject(), false));
if (this.Link != link)
{
Logger.Log("Link {0} parses to {1}...".With(new object[]
{
link,
this.Link
}), true, true);
}
this.NdcAccounts = ndcAccounts.ToList<Account>();
Logger.Log("Monitoring link {0}.".With(new object[]
{
link
}), true, true);
this.StartTime = new DateTime(2014, 10, 23);
MonitorLink monitorLink = Form1.MonitorLinkCache.FirstOrDefault((MonitorLink l) => l.Link == link);
if (monitorLink.IsNotNull())
{
this.StartTime = monitorLink.StartTime;
}
new Thread(new ThreadStart(this.DoMonitor))
{
IsBackground = true
}.Start();
}
// Token: 0x06000299 RID: 665 RVA: 0x0002AC14 File Offset: 0x00028E14
public MonitorLink()
{
}
// Token: 0x17000096 RID: 150
// (get) Token: 0x0600029B RID: 667 RVA: 0x00003490 File Offset: 0x00001690
// (set) Token: 0x0600029C RID: 668 RVA: 0x00003498 File Offset: 0x00001698
public string Link { get; set; }
// Token: 0x17000097 RID: 151
// (get) Token: 0x0600029D RID: 669 RVA: 0x000034A1 File Offset: 0x000016A1
// (set) Token: 0x0600029E RID: 670 RVA: 0x000034A9 File Offset: 0x000016A9
public List<Account> NdcAccounts { get; set; }
// Token: 0x17000098 RID: 152
// (get) Token: 0x0600029F RID: 671 RVA: 0x000034B2 File Offset: 0x000016B2
// (set) Token: 0x060002A0 RID: 672 RVA: 0x000034BA File Offset: 0x000016BA
public DateTime StartTime { get; set; }
// Token: 0x060002A1 RID: 673 RVA: 0x0002AC6C File Offset: 0x00028E6C
public void DoMonitor()
{
bool flag = false;
while (!Form1.ShouldStop && !flag)
{
Logger.Log("Checking link {0}".With(new object[]
{
this.Link
}), true, Form1.VerboseLogging);
this.CheckDirectSku();
if (!this.NdcAccounts.IsAny<Account>())
{
return;
}
if (this.NdcAccounts.All((Account a) => a.IsWebSnkrs))
{
string pid = this.Link.RegexMatch("nike.com/(snkrs|launch)/thread/(?<pid>[a-z0-9]*)").Groups["pid"].Value;
foreach (Account account in this.NdcAccounts)
{
KeyValuePair<Account, string> entry = new KeyValuePair<Account, string>(account, this.Link);
if (!MonitorLink.ProcessedLinks.Contains(entry))
{
MonitorLink.ProcessedLinks.Add(entry);
string[] size = entry.Key.Size;
for (int i = 0; i < size.Length; i++)
{
string s = size[i];
new Thread(delegate()
{
new AddToCart(new AtcItem(entry.Key, entry.Value, s)
{
Details =
{
ProductId = pid
}
}, this).Atc();
}).Start();
Logger.Log("{0} (Size {2}): Processing link {1}".With(new object[]
{
account.EmailAddress,
this.Link,
s
}), true, true);
}
}
else
{
Logger.Log("{0}: Link {1} has already been processed.".With(new object[]
{
account.EmailAddress,
this.Link
}), true, true);
}
}
return;
}
if (!Form1.UseOldMethod && !this.Link.IsNikeCollection() && !Form1.ForceOldMethod)
{
flag = this.MonitorLoadSkus();
this.DoWait(!flag);
}
else
{
flag = (this.Link.Contains("/t/") ? this.MonitorProductPageT() : this.MonitorProductPage());
this.DoWait(!flag);
}
}
}
// Token: 0x060002A2 RID: 674 RVA: 0x0002AF00 File Offset: 0x00029100
private void CheckDirectSku()
{
Account[] array = (from acc in this.NdcAccounts
where acc.Size.Length == 2 && acc.Size.First<string>().Length > 4
select acc).ToArray<Account>();
if (array.IsAny<Account>())
{
this.GetProductDetails();
if (this.Pid.IsNullOrWhiteSpace())
{
return;
}
foreach (Account account in array)
{
KeyValuePair<Account, string> item2 = new KeyValuePair<Account, string>(account, this.Link);
if (!MonitorLink.ProcessedLinks.Contains(item2))
{
MonitorLink.ProcessedLinks.Add(item2);
AtcItem item = new AtcItem(item2.Key, item2.Value, account.Size[1])
{
Details =
{
ProductId = this.Pid,
Line1 = this.Line1,
Line2 = this.Line2,
StyleCode = this.StyleCode,
ProductImage = this.Img,
Price = this.Price,
Size = account.Size[1],
SkuId = account.Size[0],
SkuAndSize = "{0}:{1}".With(new object[]
{
account.Size[0],
account.Size[1]
})
}
};
new Thread(delegate()
{
new AddToCart(item, this)
{
ForceOldMethod = Form1.ForceOldMethod
}.Atc();
}).Start();
Logger.Log("{0} (Size {2}): Processing link {1}".With(new object[]
{
account.EmailAddress,
this.Link,
account.Size[1]
}), true, true);
}
Logger.Log("{0}: Link {1} has already been processed.".With(new object[]
{
account.EmailAddress,
this.Link
}), true, true);
this.NdcAccounts.Remove(account);
}
}
}
// Token: 0x060002A3 RID: 675 RVA: 0x0002B12C File Offset: 0x0002932C
public void DoWait(bool wait)
{
if (wait)
{
if (DateTime.Now > this.StartTime + TimeSpan.FromSeconds(30.0) && DateTime.Now < this.StartTime + TimeSpan.FromMinutes(4.0))
{
Thread.Sleep(NikeWaitIntervals.MonitorTimer);
return;
}
Thread.Sleep(NikeWaitIntervals.Monitor);
}
}
// Token: 0x060002A4 RID: 676 RVA: 0x0002B19C File Offset: 0x0002939C
public static string RemoveQueryString(string url)
{
Uri uri = new Uri(url);
return "{0}://{1}{2}".With(new object[]
{
uri.Scheme,
uri.Host,
uri.AbsolutePath
});
}
// Token: 0x060002A5 RID: 677 RVA: 0x0002B1E0 File Offset: 0x000293E0
private bool MonitorAU()
{
string html;
bool result;
try
{
html = HttpHelper.GetUrl(this.Link, null, Form1.ProxyEnumeration.GetNextObject(), 10, null);
goto IL_69;
}
catch (Exception ex)
{
Logger.Log("Error: Link {0} - {1}".With(new object[]
{
this.Link,
ex.Message
}), true, true);
result = false;
}
return result;
IL_69:
if (html.Contains("Product.Config"))
{
Logger.Log("Product is up at {0}.".With(new object[]
{
this.Link
}), true, true);
foreach (Account account in this.NdcAccounts)
{
KeyValuePair<Account, string> entry = new KeyValuePair<Account, string>(account, this.Link);
if (!MonitorLink.ProcessedLinks.Contains(entry))
{
MonitorLink.ProcessedLinks.Add(entry);
string[] size = entry.Key.Size;
for (int i = 0; i < size.Length; i++)
{
string s = size[i];
new Thread(delegate()
{
new AddToCart(new AtcItem(entry.Key, entry.Value, s), this)
{
OldHtml = html,
ForceOldMethod = Form1.ForceOldMethod
}.AUAtc("");
}).Start();
Logger.Log("{0} (Size {2}): Processing link {1}".With(new object[]
{
account.EmailAddress,
this.Link,
s
}), true, true);
}
}
else
{
Logger.Log("{0}: Link {1} has already been processed.".With(new object[]
{
account.EmailAddress,
this.Link
}), true, true);
}
}
return true;
}
return false;
}
// Token: 0x060002A6 RID: 678 RVA: 0x0002B41C File Offset: 0x0002961C
private bool MonitorProductPage()
{
string html = null;
bool hasCache = false;
try
{
if (this.Pid.IsNullOrWhiteSpace())
{
this.Pid = this.Link.RegexMatch("\\/pid-(?<pid>[0-9]+)\\/?").Groups["pid"].Value;
}
}
catch (Exception)
{
}
string key = NikeUrls.NikeLoadSkus.With(new object[]
{
this.Pid
});
html = null;
try
{
html = Form1.ResponseDictionary[key];
hasCache = true;
if (this.StyleCode.IsNullOrWhiteSpace())
{
this.GetProductDetails();
}
}
catch (Exception)
{
}
bool result;
try
{
html = (html ?? this.NdcAccounts.GetRandom<Account>().Request.GetRequest(this.Link, null, null, true, true));
goto IL_122;
}
catch (Exception ex)
{
Logger.Log("Error: Link {0} - {1}".With(new object[]
{
this.Link,
ex.Message
}), true, true);
result = false;
}
return result;
IL_122:
Account account;
if (html.CQSelect("select[name=skuAndSize]").FirstOrDefault<IDomObject>().IsNotNull() || hasCache)
{
Logger.Log("Product is up at {0}.".With(new object[]
{
this.Link
}), true, true);
using (List<Account>.Enumerator enumerator = this.NdcAccounts.GetEnumerator())
{
while (enumerator.MoveNext())
{
account = enumerator.Current;
KeyValuePair<Account, string> entry = new KeyValuePair<Account, string>(account, this.Link);
if (!MonitorLink.ProcessedLinks.Contains(entry))
{
MonitorLink.ProcessedLinks.Add(entry);
string[] size = entry.Key.Size;
for (int i = 0; i < size.Length; i++)
{
string s = size[i];
new Thread(delegate()
{
new AddToCart(new AtcItem(entry.Key, entry.Value, s)
{
Details =
{
ProductId = this.Pid,
Line1 = this.Line1,
Line2 = this.Line2,
StyleCode = this.StyleCode,
ProductImage = this.Img,
Price = this.Price
}
}, this)
{
OldHtml = html,
ForceOldMethod = !hasCache
}.Atc();
}).Start();
Logger.Log("{0} (Size {2}): Processing link {1}".With(new object[]
{
account.EmailAddress,
this.Link,
s
}), true, true);
}
}
else
{
Logger.Log("{0}: Link {1} has already been processed.".With(new object[]
{
account.EmailAddress,
this.Link
}), true, true);
}
}
}
return true;
}
if (!html.CQSelect(".grid-item.fullSize[data-pdpurl*=shoe]").FirstOrDefault<IDomObject>().IsNotNull())
{
Logger.Log("Error: Link {0} - {1}".With(new object[]
{
this.Link,
"product not live yet"
}), true, true);
return false;
}
string[] array = html.CQSelect(".grid-item.fullSize[data-pdpurl] p.product-display-name").GetInnerTexts(false).ToArray<string>();
string[] array2 = (from el in html.CQSelect(".grid-item.fullSize[data-pdpurl]")
select el.GetAttribute("data-pdpurl", "")).ToArray<string>();
string[] array3 = html.CQSelect(".grid-item.fullSize[data-pdpurl] .product-subtitle").GetInnerTexts(false).ToArray<string>();
List<string[]> list = new List<string[]>();
for (int j = 0; j < array2.Length; j++)
{
if (Form1.AllSize || (array3[j].ContainsAny(Form1.MatchStrings) && array3[j].ContainsAny(Form1.ShoeStrings) && !array3[j].ContainsAny(Form1.NegativeStrings)))
{
list.Add(new string[]
{
array[j],
array2[j],
array3[j]
});
}
}
if (!list.Any<string[]>())
{
return false;
}
list = (from shoe in list
where this.NdcAccounts.Any((Account account) => !account.CollectionKeywords.Any<string>() || shoe[0].ContainsAny(account.CollectionKeywords.ToArray()))
select shoe).ToList<string[]>();
Logger.Log("Found {0} matching shoes in the collection. {1}".With(new object[]
{
list.Count,
this.Link
}), true, true);
using (List<string[]>.Enumerator enumerator2 = list.GetEnumerator())
{
while (enumerator2.MoveNext())
{
string[] shoeUrl = enumerator2.Current;
IEnumerable<Account> ndcAccounts = from account in this.NdcAccounts
where !account.CollectionKeywords.Any<string>() || shoeUrl[0].ContainsAny(account.CollectionKeywords.ToArray())
select account;
Form1.MonitorLinks.Add(new MonitorLink(shoeUrl[1], ndcAccounts));
}
}
return true;
}
// Token: 0x060002A7 RID: 679 RVA: 0x0002B99C File Offset: 0x00029B9C
private bool MonitorProductPageT()
{
bool result;
try
{
string html = null;
try
{
html = this.NdcAccounts.GetRandom<Account>().Request.GetRequest(this.Link, null, null, true, true);
}
catch (Exception ex)
{
Logger.Log("Error: Link {0} - {1}".With(new object[]
{
this.Link,
ex.Message
}), true, true);
return false;
}
string text = html.GetLinesArray(true).FirstOrDefault((string l) => l.Contains("window.INITIAL_REDUX_STATE="));
if (text == null)
{
throw new Exception("Product data not found...");
}
text = text.Replace("<script>window.INITIAL_REDUX_STATE=", "var x22xx123 = ");
text = text.Replace(";</script>", ";");
string text2 = "";
JObject jobject;
try
{
Engine engine = new Engine();
engine.Execute("window = {};");
engine.Execute(text);
JsValue value = engine.GetValue("x22xx123");
jobject = JObject.Parse(engine.Json.Stringify(value, new JsValue[]
{
value
}).ToString());
}
catch (Exception)
{
throw new Exception("Error parsing product data...");
}
MonitorLink.NikeSku[] skus;
foreach (Account account in this.NdcAccounts)
{
KeyValuePair<Account, string> item2 = new KeyValuePair<Account, string>(account, this.Link);
if (!MonitorLink.ProcessedLinks.Contains(item2))
{
MonitorLink.ProcessedLinks.Add(item2);
string productId;
string line;
string line2;
string price;
string productImage;
try
{
text2 = account.ProductStyleCodes.First<string>();
skus = jobject["Threads"]["products"][text2]["skus"].ToObject<MonitorLink.NikeSku[]>();
productId = jobject["Threads"]["products"][text2]["productId"].Value<string>();
line = jobject["Threads"]["products"][text2]["title"].Value<string>();
line2 = jobject["Threads"]["products"][text2]["subTitle"].Value<string>();
price = jobject["Threads"]["products"][text2]["currentPrice"].Value<string>();
productImage = jobject["Threads"]["products"][text2]["firstImageUrl"].Value<string>();
}
catch (Exception)
{
Logger.Log("{0}: Error parsing product data... {1}".With(new object[]
{
account.EmailAddress,
text2
}), true, true);
continue;
}
string[] size = item2.Key.Size;
for (int i = 0; i < size.Length; i++)
{
string text3 = size[i];
AtcItem item = new AtcItem(item2.Key, item2.Value, text3)
{
Details =
{
ProductId = productId,
Line1 = line,
Line2 = line2,
StyleCode = text2,
ProductImage = productImage,
Price = price
}
};
new Thread(delegate()
{
new AddToCart(item, this)
{
OldHtml = html,
ForceOldMethod = Form1.ForceOldMethod,
Skus = skus
}.Atc();
}).Start();
Logger.Log("{0} (Size {2}): Processing link {1}".With(new object[]
{
account.EmailAddress,
this.Link,
text3
}), true, true);
}
}
else
{
Logger.Log("{0}: Link {1} has already been processed.".With(new object[]
{
account.EmailAddress,
this.Link
}), true, true);
}
}
result = true;
}
catch (Exception ex2)
{
Logger.Log("Error: Link {0} - {1}".With(new object[]
{
this.Link,
ex2.Message
}), true, true);
result = false;
}
return result;
}
// Token: 0x060002A8 RID: 680 RVA: 0x0002BE90 File Offset: 0x0002A090
private bool MonitorLoadSkus()
{
string html = "";
if (this.StyleCode.IsNullOrWhiteSpace())
{
this.GetProductDetails();
}
if (this.Pid.IsNullOrWhiteSpace())
{
return true;
}
bool result;
try
{
string text = NikeUrls.NikeLoadSkus.With(new object[]
{
this.Pid
});
html = null;
try
{
html = Form1.ResponseDictionary[text];
}
catch (Exception)
{
}
html = (html ?? this.NdcAccounts.GetRandom<Account>().Request.GetRequest(text, null, null, true, true));
if (html.Contains("nike_Cart_handleJCartResponse"))
{
throw new Exception("Sizes are not yet live...");
}
if (html.Contains("xml version="))
{
if (Form1.SiteType == SiteType.NikeCN)
{
Form1.ForceOldMethod = true;
return false;
}
html = html.Trim(new char[]
{
'}',
'{'
});
html = ((!html.Contains("<response>") || html.Contains("</response>")) ? html : (html + "</response>"));
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.LoadXml(html);
html = JsonConvert.SerializeXmlNode(xmlDocument["response"]);
html = JObject.Parse(html)["response"].ToString();
}
JObject jobject = JObject.Parse(html);
if (jobject["status"].ToString() == "success")
{
JArray list = jobject["product"].Value<JArray>("childSKUs");
if (list.IsAny<JToken>())
{
using (List<Account>.Enumerator enumerator = this.NdcAccounts.GetEnumerator())
{
while (enumerator.MoveNext())
{
Account account = enumerator.Current;
KeyValuePair<Account, string> item2 = new KeyValuePair<Account, string>(account, this.Link);
if (!MonitorLink.ProcessedLinks.Contains(item2))
{
MonitorLink.ProcessedLinks.Add(item2);
string[] size = item2.Key.Size;
for (int i = 0; i < size.Length; i++)
{
string text2 = size[i];
AtcItem item = new AtcItem(item2.Key, item2.Value, text2)
{
Details =
{
ProductId = this.Pid,
Line1 = this.Line1,
Line2 = this.Line2,
StyleCode = this.StyleCode,
ProductImage = this.Img,
Price = this.Price
}
};
new Thread(delegate()
{
new AddToCart(item, this)
{
OldHtml = html,
ForceOldMethod = Form1.ForceOldMethod
}.Atc();
}).Start();
Logger.Log("{0} (Size {2}): Processing link {1}".With(new object[]
{
account.EmailAddress,
this.Link,
text2
}), true, true);
}
}
else
{
Logger.Log("{0}: Link {1} has already been processed.".With(new object[]
{
account.EmailAddress,
this.Link
}), true, true);
}
}
goto IL_429;
}
goto IL_3AA;
IL_429:
return true;
}
IL_3AA:
throw new Exception("Size details not available");
}
JToken jtoken = jobject["exceptions"];
if (jtoken.IsAny<JToken>())
{
jtoken = jtoken["error"][0];
throw new Exception("Error getting size.. Code: {0} Message: {1}".With(new object[]
{
jtoken["errorcode"],
jtoken["message"]
}));
}
throw new Exception("Size details not available");
}
catch (Exception ex)
{
Logger.Log("Error: Link {0} - {1}".With(new object[]
{
this.Link,
ex.Message
}), true, true);
result = false;
}
return result;
}
// Token: 0x060002A9 RID: 681 RVA: 0x0002C350 File Offset: 0x0002A550
private void GetProductDetails()
{
try
{
if (this.Pid.IsNullOrWhiteSpace())
{
try
{
this.Pid = this.Link.RegexMatch("\\/pid-(?<pid>[0-9]+)\\/?").Groups["pid"].Value;
this.Line1 = this.Link.RegexMatch("\\/pd\\/(?<line1>.*)\\/pid").Groups["line1"].Value.Replace("-", " ").Replace("/", "").ToLower();
this.Line1 = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(this.Line1).Replace(" Shoe", "");
}
catch (Exception)
{
}
if (this.Pid.IsNullOrWhiteSpace())
{
Logger.Log("Link {0} has invalid pid.".With(new object[]
{
this.Link
}), true, true);
return;
}
}
if (this.StyleCode.IsNullOrWhiteSpace())
{
string request = this.NdcAccounts.GetRandom<Account>().Request.GetRequest(NikeUrls.NikeLoadProduct.With(new object[]
{
this.Pid
}), null, null, true, true);
JObject jobject = JObject.Parse(request);
if (jobject["status"].ToString() == "success")
{
this.Line1 = jobject["product"]["productName1"].ToString();
this.Line2 = jobject["product"]["productName2"].ToString();
this.StyleCode = "{0}-{1}".With(new object[]
{
jobject["product"]["styleNumber"].ToString(),
jobject["product"]["colorNumber"].ToString()
});
this.Img = "https://secure-images.nike.com/is/image/DotCom/{0}".With(new object[]
{
this.StyleCode.Replace("-", "_")
});
this.Price = jobject["product"]["listPrice"].ToString();
}
}
}
catch (Exception)
{
}
}
// Token: 0x0400029D RID: 669
public static List<KeyValuePair<Account, string>> ProcessedLinks = new List<KeyValuePair<Account, string>>();
// Token: 0x0400029E RID: 670
public static int IntervalStart;
// Token: 0x0400029F RID: 671
public static int IntervalStop;
// Token: 0x040002A0 RID: 672
public string Pid = "";
// Token: 0x040002A1 RID: 673
public string Line1 = "";
// Token: 0x040002A2 RID: 674
public string Line2 = "";
// Token: 0x040002A3 RID: 675
public string StyleCode = "";
// Token: 0x040002A4 RID: 676
public string Img = "";
// Token: 0x040002A5 RID: 677
public string Price = "";
// Token: 0x0200003C RID: 60
public class NikeSku
{
// Token: 0x040002AD RID: 685
public string id;
// Token: 0x040002AE RID: 686
public string nikeSize;
}
}
}