-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreloading.sh
635 lines (630 loc) · 25.3 KB
/
reloading.sh
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
#!/bin/bash
#
#Reloading Check Script
tput setaf 4
echo "Reloading stock check script."
echo $date
echo "written by Paul Gariepy 2020"
echo "---------------------------------"
sleep 1
readarray contacts < contacts.txt
while true
do
date=`date '+%d/%m/%Y_%H:%M:%S'`
tput setaf 3
item1name="CCI #500 Small Pistol Primers"
echo "Checking $item1name @ PowderVallyInc"
item1=$( curl -s https://www.powdervalleyinc.com/product/cci-500-small-pistol-primers-1000/ | grep 'class="stock in-stock"')
if [[ $item1 == *"stock"* && $item1stocked == 0 ]]; then
tput setaf 2
echo -e "$item1name 1000ct are {RED}in stock! $date"
for name in ${contacts[@]}
do
echo "$item1name is in stock at PowderVallyInc as of $date" | mutt -s "AmmoTracker" $name
item1stocked=1
done
else
echo "$item1name 1000ct are out of stock $date"
item1stocked=0
fi
echo "---------------------------------"
#
item2name="Berrys .356 / 9mm 124 Grain Hollow Base Flat Point Thick Plate"
echo "Checking $item2name @ PowderVallyInc"
item2=$( curl -s https://www.powdervalleyinc.com/product/berrys-356-9mm-124-gr-hbfp-tp1000/ | grep 'class="stock in-stock"')
if [[ $item2 == *"stock"* && $item2stocked == 0 ]]; then
tput setaf 2
echo "$item2name 1000ct are in stock! $date"
for name in ${contacts[@]}
do
echo "$item2name is in stock at PowderVallyInc as of $date" | mutt -s "AmmoTracker" $name
item2stocked=1
done
else
echo "C$item2name 1000ct are out of stock $date"
item2stocked=0
fi
echo "---------------------------------"
item3name="Winchester Small Pistol Primers"
echo "Checking $item3name @ PowderVallyInc"
item3=$( curl -s https://www.powdervalleyinc.com/product/winchester-small-pistol-primers-1000/ | grep 'class="stock in-stock"')
if [[ $item3 == *"stock"* && $item3stocked == 0 ]]; then
tput setaf 2
echo "$item3name 1000ct are in stock! $date"
for name in ${contacts[@]}
do
echo "$item3name is in stock now at PowderVallyInc as of $date" | mutt -s "AmmoTracker" $name
item3stocked=1
done
else
echo "$item3name 1000ct are out of stock $date"
item3stocked=0
fi
echo "---------------------------------"
item4name="Federal GM100M Small Pistol Match"
echo "Checking $item4name @ PowderVallyInc"
item4=$( curl -s https://www.powdervalleyinc.com/product/federal-gm100m-sm-pstl-match-1000/ | grep 'class="stock in-stock"')
if [[ $item4 == *"stock"* && $item4stocked == 0 ]]; then
tput setaf 2
echo "$item4name 1000ct are in stock! $date"
for name in ${contacts[@]}
do
echo "$item4name is in stock now at PowederVallyInc as of $date" | mutt -s "AmmoTracker" $name
item4stocked=1
done
else
echo "$item4name 1000ct are out of stock $date"
item4stocked=0
fi
echo "---------------------------------"
item5name="Federal #100 Small Pistol Primers"
echo "Checking $item5name @ PowderVallyInc"
item5=$( curl -s https://www.powdervalleyinc.com/product/federal-100-small-pistol-primers-1000/ | grep 'class="stock in-stock"')
if [[ $item5 == *"stock"* && $item5stocked == 0 ]]; then
tput setaf 2
echo "$item5name 1000ct are in stock! $date"
for name in ${contacts[@]}
do
echo "$item5name is in stock now at PowederVallyInc as of $date" | mutt -s "AmmoTracker" $name
item5stocked=1
done
else
echo "$item5name 1000ct are out of stock $date"
item5stocked=0
fi
echo "---------------------------------"
item6name="Alliant Sport Pistol Smokeless Powder"
echo "Checking $item6name @ PowderVallyInc"
item6=$( curl -s https://www.powdervalleyinc.com/product/alliant-sport-pistol/ | grep 'class="stock in-stock"')
if [[ $item6 == *"stock"* && $item6stocked == 0 ]]; then
tput setaf 2
echo "$item6name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item6name is in stock now at PowederVallyInc as of $date" | mutt -s "AmmoTracker" $name
item6stocked=1
done
else
echo "$item6name is out of stock $date"
item6stocked=0
fi
echo "---------------------------------"
item7name="CCI Small Pistol Primers #500"
echo "Checking $item7name @ Midway"
item7=$( curl -s https://www.midwayusa.com/product/1301332027 | grep '<span ng-bind="selector.productAvailability">Available</span>')
if [[ $item7 == *"Available"* && $item7stocked == 0 ]]; then
tput setaf 2
echo "$item7name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item7name is in stock now at Midway as of $date" | mutt -s "AmmoTracker" $name
item7stocked=1
done
else
echo "$item7name is out of stock $date"
item7stocked=0
fi
echo "---------------------------------"
item8name="Federal Premium Gold Medal Small Pistol Match Primers #100M"
echo "Checking $item8name @ Midway"
item8=$( curl -s https://www.midwayusa.com/product/953619121 | grep '<span ng-bind="selector.productAvailability">Available</span>')
if [[ $item8 == *"Available"* && $item8stocked == 0 ]]; then
tput setaf 2
echo "$item8name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item8name is in stock now at Midway as of $date" | mutt -s "AmmoTracker" $name
item8stocked=1
done
else
echo "$item8name is out of stock $date"
item8stocked=0
fi
echo "---------------------------------"
item9name="Federal Small Pistol Primers #100"
echo "Checking $item9name @ Midway"
item9=$( curl -s https://www.midwayusa.com/product/953733657 | grep '<span ng-bind="selector.productAvailability">Available</span>')
if [[ $item9 == *"Available"* && $item9stocked == 0 ]]; then
tput setaf 2
echo "$item9name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item9name is in stock now at Midway as of $date" | mutt -s "AmmoTracker" $name
item9stocked=1
done
else
echo "$item9name is out of stock $date"
item9stocked=0
fi
echo "---------------------------------"
item10name="Winchester Small Pistol Primers #1-1/2"
echo "Checking $item10name @ Midway"
item10=$( curl -s https://www.midwayusa.com/product/2900166619 | grep '<span ng-bind="selector.productAvailability">Available</span>')
if [[ $item10 == *"Available"* && $item10stocked == 0 ]]; then
tput setaf 2
echo "$item10name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item10name is in stock now at Midway as of $date" | mutt -s "AmmoTracker" $name
item10stocked=1
done
else
echo "$item10name is out of stock $date"
item10stocked=0
fi
echo "---------------------------------"
item11name="CCI Standard Primers #500 Small Pistol"
echo "Checking $item11name @ Natchez Shooters Supplies"
item11=$( curl -s https://www.natchezss.com/cci-standard-primers-500-small-pistol.html | grep '<span>In stock</span>')
if [[ $item11 == *"stock"* && $item11stocked == 0 ]]; then
tput setaf 2
echo "$item11name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item11name is in stock now at Natchez Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item11stocked=1
done
else
echo "$item11name is out of stock $date"
item11stocked=0
fi
echo "---------------------------------"
item12name="Federal Premium Champion Centerfire Primers Small Pistol"
echo "Checking $item12name @ Natchez Shooters Supplies"
item12=$( curl -s https://www.natchezss.com/federal-premium-champion-centerfire-primers-small-pistol.html | grep '<span>In stock</span>')
if [[ $item12 == *"stock"* && $item12stocked == 0 ]]; then
tput setaf 2
echo "$item12name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item12name is in stock now at Natchez Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item12stocked=1
done
else
echo "$item12name is out of stock $date"
item12stocked=0
fi
echo "---------------------------------"
item13name="Fiocchi Primers- Small Pistol"
echo "Checking $item13name @ Natchez Shooters Supplies"
item13=$( curl -s https://www.natchezss.com/fiocchi-primers-small-pistol.html | grep '<span>In stock</span>')
if [[ $item13 == *"stock"* && $item13stocked == 0 ]]; then
tput setaf 2
echo "$item13name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item13name is in stock now at Natchez Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item13stocked=1
done
else
echo "$item13name is out of stock $date"
item13stocked=0
fi
echo "---------------------------------"
item14name="Federal Gold Medal Small Pistol Primer 1000/ct"
echo "Checking $item14name @ Natchez Shooters Supplies"
item14=$( curl -s https://www.natchezss.com/federal-gold-medal-small-pistol-primer-1000-ct.html | grep '<span>In stock</span>')
if [[ $item14 == *"stock"* && $item14stocked == 0 ]]; then
tput setaf 2
echo "$item14name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item14name is in stock now at Natchez Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item14stocked=1
done
else
echo "$item14name is out of stock $date"
item14stocked=0
fi
echo "---------------------------------"
item15name="Winchester Small Pistol Primers"
echo "Checking $item15name @ Natchez Shooters Supplies"
item15=$( curl -s https://www.natchezss.com/winchester-small-pistol-primers.html | grep '<span>In stock</span>')
if [[ $item15 == *"stock"* && $item15stocked == 0 ]]; then
tput setaf 2
echo "$item15name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item15name is in stock now at Natchez Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item15stocked=1
done
else
echo "$item15name is out of stock $date"
item15stocked=0
fi
echo "---------------------------------"
item17name="Federal Small Pistol Primer #100 (1000 Count)"
echo "Checking $item17name @ MidSouth Shooters"
item17=$( curl -s 'https://www.midsouthshooterssupply.com/item/00129100/federal-small-pistol-primer-number-100-(1000-count)' | grep '>In Stock</span>')
if [[ $item17 == *"stock"* && $item17stocked == 0 ]]; then
tput setaf 2
echo "$item17name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item17name is in stock now at MidSouth Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item17stocked=1
done
else
echo "$item17name is out of stock $date"
item17stocked=0
fi
echo "---------------------------------"
item18name="Gold Medal Small Pistol Match Primer #GM100M (1000 Count)"
echo "Checking $item18name @ MidSouth Shooters"
item18=$( curl -s 'https://www.midsouthshooterssupply.com/item/00129gm100m/gold-medal-small-pistol-match-primer-number-gm100m-(1000-count)' | grep '>In Stock</span>')
if [[ $item18 == *"stock"* && $item18stocked == 0 ]]; then
tput setaf 2
echo "$item18name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item18name is in stock now at MidSouth Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item18stocked=1
done
else
echo "$item18name is out of stock $date"
item18stocked=0
fi
echo "---------------------------------"
item19name="Gold Medal Magnum Small Pistol Match Primer #GM200M (1000 Count)"
echo "Checking $item19name @ MidSouth Shooters"
item19=$( curl -s 'https://www.midsouthshooterssupply.com/item/00129gm200m/gold-medal-magnum-small-pistol-match-primer-number-gm200m-(1000-count)' | grep '>In Stock</span>')
if [[ $item19 == *"stock"* && $item19stocked == 0 ]]; then
tput setaf 2
echo "$item19name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item19name is in stock now at MidSouth Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item19stocked=1
done
else
echo "$item19name is out of stock $date"
item19stocked=0
fi
echo "---------------------------------"
item20name="CCI #500 Small Pistol Primer 5000 Count Case"
echo "Checking $item20name @ MidSouth Shooters"
item20=$( curl -s 'https://www.midsouthshooterssupply.com/item/00350p0014c/-number-500-small-pistol-primer-5000-count-case' | grep '>In Stock</span>')
if [[ $item20 == *"stock"* && $item20stocked == 0 ]]; then
tput setaf 2
echo "$item20name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item20name is in stock now at MidSouth Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item20stocked=1
done
else
echo "$item20name is out of stock $date"
item20stocked=0
fi
echo "---------------------------------"
item21name="Federal Small Pistol Primer #100 (5000 Count Case)"
echo "Checking $item21name @ MidSouth Shooters"
item21=$( curl -s 'https://www.midsouthshooterssupply.com/item/00350p100c/federal-small-pistol-primer-number-100-(5000-count-case)' | grep '>In Stock</span>')
if [[ $item21 == *"stock"* && $item21stocked == 0 ]]; then
tput setaf 2
echo "$item21name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item21name is in stock now at MidSouth Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item21stocked=1
done
else
echo "$item21name is out of stock $date"
item21stocked=0
fi
echo "---------------------------------"
item22name="Gold Medal Small Pistol Match Primer #GM100M (5000 Count Case)"
echo "Checking $item22name @ MidSouth Shooters"
item22=$( curl -s 'https://www.midsouthshooterssupply.com/item/00350pgm100mc/gold-medal-small-pistol-match-primer-number-gm100m-(5000-count-case)' | grep '>In Stock</span>')
if [[ $item22 == *"stock"* && $item22stocked == 0 ]]; then
tput setaf 2
echo "$item22name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item22name is in stock now at MidSouth Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item22stocked=1
done
else
echo "$item22name is out of stock $date"
item22stocked=0
fi
echo "---------------------------------"
item23name="Gold Medal Magnum Small Pistol Match Primer #GM200M (5000 Count Case)"
echo "Checking $item23name @ MidSouth Shooters"
item23=$( curl -s 'https://www.midsouthshooterssupply.com/item/00350pgm200mc/gold-medal-magnum-small-pistol-match-primer-number-gm200m-(5000-count-case)' | grep '>In Stock</span>')
if [[ $item23 == *"stock"* && $item23stocked == 0 ]]; then
tput setaf 2
echo "$item23name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item23name is in stock now at MidSouth Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item23stocked=1
done
else
echo "$item23name is out of stock $date"
item23stocked=0
fi
echo "---------------------------------"
item24name="Winchester Small Pistol Primers 5000 Count Case"
echo "Checking $item24name @ MidSouth Shooters"
item24=$( curl -s 'https://www.midsouthshooterssupply.com/item/00350pwspc/winchester-small-pistol-primers-5000-count-case' | grep '>In Stock</span>')
if [[ $item24 == *"stock"* && $item24stocked == 0 ]]; then
tput setaf 2
echo "$item24name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item24name is in stock now at MidSouth Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item24stocked=1
done
else
echo "$item24name is out of stock $date"
item24stocked=0
fi
echo "---------------------------------"
item25name="Fiocchi Small Pistol Primers 12,000 Count Case (8 Boxes of 1500)"
echo "Checking $item25name @ MidSouth Shooters"
item25=$( curl -s 'https://www.midsouthshooterssupply.com/item/00350445smpcase/fiocchi-small-pistol-primers-12-and-000-count-case-(8-boxes-of-1500)' | grep '>In Stock</span>')
if [[ $item25 == *"stock"* && $item25stocked == 0 ]]; then
tput setaf 2
echo "$item25name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item25name is in stock now at MidSouth Shooters Supplies as of $date" | mutt -s "AmmoTracker" $name
item25stocked=1
done
else
echo "$item25name is out of stock $date"
item25stocked=0
fi
echo "---------------------------------"
item26name="CCI PRIMER 500 SMALL PISTOL 1000/BOX"
echo "Checking $item26name @ Graf & Sons"
item26=$( curl -s https://www.grafs.com/retail/catalog/product/productId/2605 | grep 'Availability:' | grep 'In Stock')
if [[ $item26 == *"stock"* && $item26stocked == 0 ]]; then
tput setaf 2
echo "$item26name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item26name is in stock now at Graf & Sons as of $date" | mutt -s "AmmoTracker" $name
item26stocked=1
done
else
echo "$item26name is out of stock $date"
item26stocked=0
fi
echo "---------------------------------"
item27name="FEDERAL PRIMER SMALL PISTOL 1000/BOX"
echo "Checking $item27name @ Graf & Sons"
item27=$( curl -s https://www.grafs.com/retail/catalog/product/productId/21351 | grep 'Availability:' | grep 'In Stock')
if [[ $item27 == *"stock"* && $item27stocked == 0 ]]; then
tput setaf 2
echo "$item27name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item27name is in stock now at Graf & Sons as of $date" | mutt -s "AmmoTracker" $name
item27stocked=1
done
else
echo "$item27name is out of stock $date"
item27stocked=0
fi
echo "---------------------------------"
item28name="FEDERAL PRIMER SMALL PISTOL MAGNUM MATCH 1000/BOX
"
echo "Checking $item28name @ Graf & Sons"
item28=$( curl -s https://www.grafs.com/retail/catalog/product/productId/21362 | grep 'Availability:' | grep 'In Stock')
if [[ $item28 == *"stock"* && $item28stocked == 0 ]]; then
tput setaf 2
echo "$item28name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item28name is in stock now at Graf & Sons as of $date" | mutt -s "AmmoTracker" $name
item28stocked=1
done
else
echo "$item28name is out of stock $date"
item28stocked=0
fi
echo "---------------------------------"
item29name="FEDERAL PRIMER SMALL PISTOL MATCH 1000/BOX"
echo "Checking $item29name @ Graf & Sons"
item29=$( curl -s https://www.grafs.com/retail/catalog/product/productId/21359 | grep 'Availability:' | grep 'In Stock')
if [[ $item29 == *"stock"* && $item29stocked == 0 ]]; then
tput setaf 2
echo "$item29name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item29name is in stock now at Graf & Sons as of $date" | mutt -s "AmmoTracker" $name
item29stocked=1
done
else
echo "$item29name is out of stock $date"
item29stocked=0
fi
echo "---------------------------------"
item30name="WINCHESTER PRIMER SMALL PISTOL 1000/BOX"
echo "Checking $item30name @ Graf & Sons"
item30=$( curl -s https://www.grafs.com/retail/catalog/product/productId/21632| grep 'Availability:' | grep 'In Stock')
if [[ $item30 == *"stock"* && $item30stocked == 0 ]]; then
tput setaf 2
echo "$item30name is in stock! $date"
for name in ${contacts[@]}
do
echo "$item30name is in stock now at Graf & Sons as of $date" | mutt -s "AmmoTracker" $name
item30stocked=1
done
else
echo "$item27name is out of stock $date"
item30stocked=0
fi
echo "---------------------------------"
item31name="FEDERAL - PISTOL PRIMERS"
echo "Checking $item31name @ Brownwells"
item31=$( curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (K HTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" https://www.brownells.com/reloading/primers/pistol-primers/pistol-primers-prod35322.aspx | grep -i -A 1 '<span id="ctl00_ContentPlaceHolderColMain_ucSKUList_rptSkuList_ctl01_mfr" class="mfr" itemprop="availability">')
if [[ $item31 == *"In Stock"* && $item31stocked == 0 ]]; then
tput setaf 2
echo "$item31name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item31name is in stock now at Brownwells as of $date" | mutt -s "AmmoTracker" $name
item31stocked=1
done
else
echo "$item31name is out of stock $date"
item31stocked=0
fi
echo "---------------------------------"
item16name="FEDERAL - PREMIUM GOLD MEDAL PISTOL PRIMERS"
echo "Checking $item16name @ Brownwells"
item16=$( curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (K HTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" https://www.brownells.com/reloading/primers/pistol-primers/premium-gold-medal-pistol-primers-prod79084.aspx | grep -i -A 1 '<span id="ctl00_ContentPlaceHolderColMain_ucSKUList_rptSkuList_ctl01_mfr" class="mfr" itemprop="availability">')
if [[ $item16 == *"In Stock"* && $item16stocked == 0 ]]; then
tput setaf 2
echo "$item16name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item16name is in stock now at Brownwells as of $date" | mutt -s "AmmoTracker" $name
item16stocked=1
done
else
echo "$item16name is out of stock $date"
item16stocked=0
fi
echo "---------------------------------"
item32name="CCI - PISTOL PRIMERS"
echo "Checking $item32name @ Brownwells"
item32=$( curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (K HTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" https://www.brownells.com/reloading/primers/pistol-primers/pistol-primers-prod79081.aspx | grep -i -A 1 '<span id="ctl00_ContentPlaceHolderColMain_ucSKUList_rptSkuList_ctl01_mfr" class="mfr" itemprop="availability">')
if [[ $item32 == *"In Stock"* && $item32stocked == 0 ]]; then
tput setaf 2
echo "$item32name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item32name is in stock now at Brownwells as of $date" | mutt -s "AmmoTracker" $name
item32stocked=1
done
else
echo "$item32name is out of stock $date"
item32stocked=0
fi
echo "---------------------------------"
item33name="WINCHESTER - PISTOL PRIMERS"
echo "Checking $item33name @ Brownwells"
item33=$( curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (K HTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" https://www.brownells.com/reloading/primers/pistol-primers/pistol-primers-prod55055.aspx | grep -i -A 1 '<span id="ctl00_ContentPlaceHolderColMain_ucSKUList_rptSkuList_ctl01_mfr" class="mfr" itemprop="availability">')
if [[ $item33 == *"In Stock"* && $item33stocked == 0 ]]; then
tput setaf 2
echo "$item33name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item33name is in stock now at Brownwells as of $date" | mutt -s "AmmoTracker" $name
item33stocked=1
done
else
echo "$item33name is out of stock $date"
item33stocked=0
fi
echo "---------------------------------"
item34name="WINCHESTER - PISTOL MATCH PRIMER"
echo "Checking $item34name @ Brownwells"
item34=$( curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (K HTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36" https://www.brownells.com/reloading/primers/pistol-primers/pistol-match-primer-prod133186.aspx | grep -i -A 1 '<span id="ctl00_ContentPlaceHolderColMain_ucSKUList_rptSkuList_ctl01_mfr" class="mfr" itemprop="availability">')
if [[ $item34 == *"In Stock"* && $item34stocked == 0 ]]; then
tput setaf 2
echo "$item34name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item34name is in stock now at Brownwells as of $date" | mutt -s "AmmoTracker" $name
item34stocked=1
done
else
echo "$item34name is out of stock $date"
item34stocked=0
fi
echo "---------------------------------"
item35name="WSP WIN SMALL PISTOL SP PRIMERS"
echo "Checking $item35name @ Recob’s Target Shop"
item35=$( curl -s https://recobstargetshop.com/product/wsp-win-small-pistol-sp-primers/ | grep 'In stock</p>')
if [[ $item35 == *"In Stock"* && $item35stocked == 0 ]]; then
tput setaf 2
echo "$item35name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item35name is in stock now at Recob’s Target Shop as of $date" | mutt -s "AmmoTracker" $name
item35stocked=1
done
else
echo "$item35name is out of stock $date"
item35stocked=0
fi
echo "---------------------------------"
item36name="FED 200 SMALL PISTOL MAG PRIMERS"
echo "Checking $item36name @ Recob’s Target Shop"
item36=$( curl -s https://recobstargetshop.com/product/fed-200-small-pistol-mag-primers/ | grep 'In stock</p>')
if [[ $item36 == *"In Stock"* && $item36stocked == 0 ]]; then
tput setaf 2
echo "$item36name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item36name is in stock now at Recob’s Target Shop as of $date" | mutt -s "AmmoTracker" $name
item36stocked=1
done
else
echo "$item36name is out of stock $date"
item36stocked=0
fi
echo "---------------------------------"
item37name="FED GM200M MATCH SMALL PISTOL MAGNUM PRIMER"
echo "Checking $item37name @ Recob’s Target Shop"
item37=$( curl -s https://recobstargetshop.com/product/fed-gm200m-match-small-pistol-magnum-primer/ | grep 'In stock</p>')
if [[ $item37 == *"In Stock"* && $item37stocked == 0 ]]; then
tput setaf 2
echo "$item37name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item37name is in stock now at Recob’s Target Shop as of $date" | mutt -s "AmmoTracker" $name
item37stocked=1
done
else
echo "$item37name is out of stock $date"
item37stocked=0
fi
echo "---------------------------------"
item38name="SPORT PISTOL 1# ALLIANT SMOKELESS POWDER"
echo "Checking $item38name @ Recob’s Target Shop"
item38=$( curl -s https://recobstargetshop.com/product/sport-pistol-1-alliant-smokeless-powder/ | grep 'In stock</p>')
if [[ $item38 == *"In Stock"* && $item38stocked == 0 ]]; then
tput setaf 2
echo "$item38name are in stock! $date"
for name in ${contacts[@]}
do
echo "$item38name is in stock now at Recob’s Target Shop as of $date" | mutt -s "AmmoTracker" $name
item38stocked=1
done
else
echo "$item38name is out of stock $date"
item38stocked=0
fi
echo "---------------------------------"
tput setaf 7
echo ""
echo "Script complete"
echo "waiting 1min"
sleep 60
done