forked from gopherxx/Lowes-price-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lowes Price Checker.user.js
2644 lines (2530 loc) · 282 KB
/
Lowes Price Checker.user.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
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
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ==UserScript==
// @name Lowes Price Checker
// @namespace LPC
// @id Lowes Price Checker
// @description Adds a button to check inventory and prices at a set of Lowes stores.
// @include http://www.lowes.com/pd*
// @include https://www.lowes.com/pd*
// @include http://m.lowes.com/pd*
// @include https://m.lowes.com/pd*
// @include http://www.lowes.com/ProductDisplay*
// @include https://www.lowes.com/ProductDisplay*
// @resource jqcss https://code.jquery.com/ui/1.11.4/themes/ui-lightness/jquery-ui.css
// @require http://code.jquery.com/jquery-2.2.3.min.js
// @require https://code.jquery.com/ui/1.11.4/jquery-ui.min.js
// @screenshot https://i949.photobucket.com/albums/ad337/pcazzola/lpc_1.png http://i949.photobucket.com/albums/ad337/pcazzola/lpc_icon.png
// @noframes
// @grant unsafeWindow
// @grant GM_addStyle
// @grant GM_getResourceText
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_registerMenuCommand
// @noframes
// @version 3.1.6
// @run-at document-end
// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=FDW4NZ6PRMDMJ&lc=US&item_name=Lowes%20Price%20Checker&item_number=LPC¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
// @contributionAmount $5.00
// ==/UserScript==
// Copyright Phllip Cazzola 2015, 2016
// Lowes Price Checker is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
// See http://creativecommons.org/licenses/by-nc-sa/4.0/ for license details.
//
// Contributions by Wesley Hampton
//
// The developer has no associated with Lowe's Company, Inc or the Lowe's home improvements stores.
// The word "Lowes" in the title is used for identification and does not imply endorsement by Lowes Company, Inc.
//
// 2.2 Update for Lowes website change
// 3.0 Updated to work on non-mobile site. Added store picking functionality
// 3.1 Fixes for Lowes website change
// get our own version of jquery. The first line should be enough, but Android tampermonkey needed something more explicit....
var jq_2 = this.$ = this.jQuery = jQuery.noConflict(true);
// create a jquery variable and pass it into main
//var jq_2 = jQuery.noConflict(true);
// conditional debugging
const DEBUG = false;
function my_debug(txt) {
if (DEBUG && console) {
console.log(txt);
}
}
// starting ....
my_debug('Lowes price checker script start');
// not used. Was used for making separate calls for price and quantity
var resHolder = {};
// list of store locations and zip codes
var storeData = {};
// list of store to search
var searchStore = {};
//options, default values
defOptions = {};
defOptions.sortSel = "any";
defOptions.hideEmpty = false;
defOptions.speed = 10;
// sorted list for the results
var sortedRes = new Array();
// the 50 states + DC
var states = [
'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL', 'GA',
'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD',
'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ',
'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC',
'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY',
'DC'];
// "main"
(function ($) {
// product ID
var prodId;
// product name
var prodName;
// create a variable to hold the store table.
var tableNodes = null;
// this tab is big and not always used. Delay creation until it is activated
var createdStoreSel=false;
var baseURL = unsafeWindow.location.href;
try {
var re = new RegExp('.*lowes.com\/');
var pMatch = re.exec(baseURL);
if (pMatch && pMatch.length >= 1) baseURL = pMatch[0];
} catch (e) {
my_debug(e);
}
// fill in the stores
buildStoreList();
// retrieve any saved values
searchStore = JSON.parse(GM_getValue('searchStore', JSON.stringify(searchStore)));
if (!searchStore) {
//JSON.parse() there is an error in the input string
my_debug('Error! JSON.parse failed - The stored value for "searchStore" is likely to be corrupted.');
searchStore = {};
}
options = JSON.parse(GM_getValue('options', JSON.stringify(defOptions)));
if (!options) {
//JSON.parse() there is an error in the input string
my_debug('Error! JSON.parse failed - The stored value for "options" is likely to be corrupted.');
options = defOptions;
}
// apply the default jQuery theme
var newCSS = GM_getResourceText('jqcss');
// put in our unique class ID so this doesn't change the styles for the main page
newCSS = newCSS.replace(/^\.ui-/gm, ".icDiag .ui-" );
GM_addStyle(newCSS);
//--- creates CSS styles so the popup looks OK...
GM_addStyle(
'.icDiag.ui-dialog {border: 1px solid #0068ab !important; box-shadow: 2px 2px 5px rgba(0,0,0,0.65);} \
.icDiag .ui-widget input, .icDiag .ui-widget select, .icDiag .ui-widget textarea, .icDiag .ui-widget button { opacity: 100; position: relative; } \
.icDiag.ui-dialog.ui-widget .ui-dialog-titlebar { \
display: block; font-size:1.0em; text-align: center; \
background: #15B6E5; color: white; border-width: 0px 0px 1px 0px; border-color: none none #ccc none ; } \
.icDiag.ui-dialog.ui-widget .ui-dialog-titlebar { padding: 0px; border-radius: 8px 8px 0px 0px; height: 2em;} \
.icDiag.ui-dialog .ui-dialog-title { padding: 0em; float: none;} \
.icDiag.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button {display: inline-block;} \
.icDiag.ui-dialog.ui-widget.ui-widget .ui-dialog-buttonpane .ui-dialog-buttonset button { \
text-align: center; background: transparent; color: #0471af; display: inline-block; \
font-size: 1em; margin: 0; width: 50%; border-radius: 0; \
border-right: 1px solid #ccc; border-left: none; border-bottom: none; border-top:none}\
#mySSTable {width: 100%;} \
#myTable {width: 100%; min-width: 400px;} \
#icDialog {padding: 0.25em; overflow-y: scroll; background: white;} \
#icDialog .ui-widget .ui-widget { font-size: 1em; } \
#icDialog .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { border-bottom-right-radius: 4px; } \
#icDialog .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl {border-bottom-left-radius: 4px; } \
#icDialog .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { border-top-right-radius: 4px; } \
#icDialog .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { border-top-left-radius: 4px; } \
#icDialog .ui-widget-content { background: white; color: #333333; } \
#icDialog .ui-tabs { position: relative; padding: .2em; } \
#icDialog .ui-widget {font-family: "Helvetica Neue",Helvetica,Arial,sans-serif !important;} \
.icDiag.ui-dialog .ui-widget .ui-dialog-titlebar { padding: 0px; } \
.icDiag.ui-dialog .ui-widget .ui-dialog-titlebar { display: block; font-size: 1.0em; text-align: center; background: #15B6E5; color: white; border-width: 0px 0px 1px 0px; border-color: none none #ccc none; } \
.icDiag.ui-dialog.ui-widget .ui-dialog-titlebar { cursor: move;} \
.icDiag.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative;} \
#icDialog .ui-draggable-handle { -ms-touch-action: none; touch-action: none; } \
#icDialog .ui-helper-clearfix { min-height: 0; } \
#icDialog div.ui-dialog-buttonpane { padding: 0;} \
.icDiag.ui-dialog.ui-widget.ui-widget .ui-dialog-buttonpane .ui-dialog-buttonset { float: none; clear: both; margin: 0; border-top: 1px solid #ccc; text-align: center; } \
.icDiag.ui-dialog.ui-widget.ui-widget .ui-dialog-buttonpane .ui-dialog-buttonset button:last-child { border-right: 0 none; } \
#icDialog .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; font-weight: bold; color: #1c94c4; height: auto; background: white; } \
#icDialog table th, table td { border-bottom: 1px solid #ddd; padding: 8px; text-align: center; vertical-align: top; width: auto;} \
#icDialog table tr:nth-child(2n) { background-color: #f2f2f2; } \
#icDialog thead, tr { border-top: 1px solid #d7dee9; height: 2em; } \
#icDialog table th { font-family: "HelveticaNeueW01-75Bold",Helvetica,Arial,sans-serif; } \
#icDialog .ui-tabs .ui-tabs-panel { display: block; height: auto; overflow: visible; border-width: 0; padding: 1em 1.4em; background: none; } \
.icDiag.ui-dialog.ui-widget .ui-widget-content a { color: #0471af; } \
.pc-tab tr th { background: #15B6E5; color: white; } \
.icDiag .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } \
.icDiag .ui-tabs .ui-tabs-panel {display: block; border-width: 0; padding: 1em 1.4em; background: none; } \
.icDiag .ui-tabs .ui-tabs-nav .ui-tabs-anchor { float: left; text-decoration: none; } \
.icDiag .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 0px .2em 0 0; border-bottom-width: 0; padding: 0; white-space: nowrap; } \
#icDialog .ui-dialog.ui-widget .ui-widget-content a { color: #0471af; } \
#icDialog .ui-tabs .ui-tabs-nav .ui-tabs-anchor { float: left; padding: .5em 1em; text-decoration: none; } \
#icDialog .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; margin-bottom: -5px; padding-bottom: 4px; background: #f6f6f6 url("images/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x; font-weight: bold; color: #1c94c4; } \
#icDialog .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; border-bottom: 0; border-bottom-width: 0; background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; font-weight: bold; color: #eb8f00; } \
#icDialog .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } \
.icDiag .ui-tabs .ui-tabs-nav li.ui-tabs-active {} \
.icDiag .ui-widget-header { border: 1px solid #e78f08; color: #ffffff; font-weight: bold; } \
.icDiag .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: white; overflow: auto; } \
#checkPrice .btn.btn-green, .btn.btn-shop { color: #fff; background: #44bb41; border: 0; padding: 12px 15px; cursor: pointer; margin-left: 50px; } \
#getStDiv .btn.btn-green, .btn.btn-shop { color: #fff; background: #44bb41; border: 0; padding: 12px 15px; cursor: pointer; } \
.icDiag .ui-dialog-titlebar-close { display: none; } \
#icDialog.ui-dialog .ui-dialog-titlebar-close { display: none !important; } \
#icDialog .ui-widget-content { color: #333333; } \
.pc-tab th, .pc-tab td { text-align: center;} \
.pc-tab td { text-align: center; border: 1px solid #ccc;} \
table.pc-tab {border-collapse: separate;} \
#myTableFooter h3 {text-align: center;} \
#myTableHeader h3 {text-align: center; max-width: 500px;} \
#mySSTableHeader div {padding-bottom: 0.5em;} \
.pc-tab tr th:first-child {border-top-left-radius: 15px;} \
.pc-tab tr th:last-child {border-top-right-radius: 15px;} \
.pc-tab tr:last-child td:first-child {border-bottom-left-radius: 15px;} \
.pc-tab tr:last-child td:last-child {border-bottom-right-radius: 15px;} \
.pc-tab tr th {background: #15B6E5; color: white;} \
#NS_DIV p {text-align: center; } \
#tabs-options {border: 1px solid #ddd !important; min-height: 300px; min-width: 500px;} \
#tabs-storesel {border: 1px solid #ddd !important; min-height: 300px; min-width: 500px;} \
#tabs-price-check {border: 1px solid #ddd !important; min-height: 300px; min-width: 500px;}\
#icDialog .ui-tabs-nav {background: white;} \
#tab_ul { border: none;}' );
// Wait for the window to load. Then fix the "See price in cart"
window.addEventListener('load', function () {
// look for the div w/ "See price in cart". If it is there, show the price
try {
var realPrice = unsafeWindow.Lowes.ProductDetail.product.ProductInfo.lowesPrice;
$('p.view-in-cart').append('<a>$' + realPrice + '</a>');
} catch (err) {
my_debug(err.message);
}
getProductId();
}, false);
// add a button to the web page above the product image to bring up the price checker popup
$('#mainContent').prepend('<div id="checkPrice"><button id="checkPriceBtn" class="btn btn-green">Check Prices</button></div>');
$('#detailCont').prepend('<div id="checkPrice"><button id="checkPriceBtn" class="btn btn-green">Check Prices</button></div>');
// add an action with the price check button is pressed -> open dialog
$('#checkPriceBtn').click(function () {
// scrape the product description from the web page to put on the popup
try {
getProductName();
$('#myTableHeader h3').html(prodName);
} catch (err) {
my_debug(err.message);
}
showPopup();
});
// create the dialog box to display the results
$('body').append('<div id="icDialog" title="Price Check"/>');
// create the tabbed panes for options/checker
$('#icDialog').html(
'<div style="display: inline-block;"> \
<ul id="tab_ul" style="display: inline-block; width: 90%;"> \
<li><a href="#tabs-price-check">Prices</a></li> \
<li><a href="#tabs-storesel">Stores</a></li> \
<li><a href="#tabs-options">Options</a></li> \
<li><a href="#tabs-info">Info</a></li> \
</ul> \
<div id="tabs-price-check"></div> \
<div id="tabs-storesel"> Store Selection tab </div> \
<div id="tabs-options"> Options tab </div> \
<div id="tabs-info"> Info tab </div> \
</div>');
// generate the tabbed panes
$('#icDialog').tabs({heightStyle: 'content',
beforeActivate: function (event, ui) {
if (ui.newPanel.is("#tabs-storesel")){
// store selector tab activated
if (!createdStoreSel) {
createdStoreSel = true;
buildStoreTable();
}
}}
});
$("#icDialog").tabs().css({'min-height': '400px', 'overflow': 'auto' });
$('#icDialog').tabs('option', 'active', 3);
// generate dialog/set properties
$('#icDialog').dialog({
title: 'Price Checker',
draggable: true,
height: 'auto',
maxHeight: 600,
minHeight: 400,
width: '600px',
minWidth: 600,
maxWidth: 800,
resizable: true,
autoOpen: false,
buttons: {
'Search': goAction,
'Close': function () {
// detach the large table to improve performance
tableNodes = $('#mySSTable').detach();
$("#myTable").hide();
var tab2 = $("#myTable").detach();
$('body').append(tab2);
$(this).dialog('close');
}
}
});
// add a class to the dialog box elements to apply CSS properties without affecting other parts of the web page
$('#icDialog').parent().addClass('icDiag');
$('#icDialog').parent().css('z-index', 1000);
$('#icDialog').parent().css('position', 'absolute');
// create a table to put the results in
$('#tabs-price-check').html(
'<div id="myTableHeader" data-role="header"><h3 class="pd-title"> </h3></div> \
<div id="tabHolder2"><table data-role="table" data-mode="columntoggle" class="ui-responsive ui-shadow pc-tab" id="myTable"> \
<thead> \
<tr><th>Store</th><th data-priority="1">Quantity</th><th data-priority="2">Price</th><th data-priority="3">Shipping</th></tr> \
</thead> \
<tbody id="myTabBody"></tbody> \
</table></div> \
<div id="myTableFooter" data-role="footer"><h3> </h3></div>');
// build the store selection tab. List of stores with check boxes
$('#tabs-storesel').html(
'<div id="mySSTableHeader" data-role="header"></div> \
<div id="tabHolder"><table data-role="table" style="min-width: 400px;" data-mode="columntoggle" class="ui-responsive ui-shadow pc-tab" id="mySSTable"> \
<thead> \
<tr><th style="width: 20%;">Use</th><th style="width: 30%;" data-priority="1">Store Number</th><th style="width: 50%;" data-priority="2">Location</th></tr>\
</thead>\
<tbody id="mySSTabBody"></tbody>\
</table></div> \
<div id="mySSTableFooter" data-role="footer" style="display: inline; font-size: 0.5em;"> \
</div>');
$('#tabs-info').html("<div id='NS_DIV' style='min-width: 400px; max-width: 600px;'> \
<p><b> Lowes Price Checker </b></p> \
<p> If this tool has saved you money, consider donating to the developer via PayPal. </p> \
<div id='donate'><input style='display: block; margin-left: auto; margin-right:auto;' type='image' id='donateBtn' src='https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif' alt='Donate'></input></div> \
<hr/><div id='storeSearcher'><p> Find all Lowe's stores in the USA.</p> \
<p> This generates a list of all stores that can be pasted into the script.</p> \
<p> -- Warning this action takes a few minutes. --</p> \
<div id='getStDiv' style='margin-left: 40%;' ><button type='button' id='getStores' class='btn btn-green'>Find Stores</button></div></div></DIV>");
$('#getStores').click(function () { findStores(); });
$('#donateBtn').click(function () {
var win = window.open("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=FDW4NZ6PRMDMJ&lc=US&item_name=Lowes%20Price%20Checker&item_number=LPC¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted", '_blank');
win.focus();
});
// create some controls for the store list table
$('#mySSTableHeader').html(
"<div style='margin-bottom: 0.5em; text-align: center;'><button type='button' id='allBtn' style='margin-left: 20px;'>Add all</button> \
<button type='button' id='clrBtn' style='margin-left: 20px;'>Remove all</button></div>" +
"<div style='clear:left;'>State: <select id='stateSel' style='width: 100px;'></select></div>" +
"<div style='clear: left;'>Distance: <select id='distSel' style='text-align: center; width: 4em;'></select> miles " +
"of zip: <input type='text' id='zzipInput' maxLength=5 style='width: 3em; text-align: center;'/> </div>");
// fill in the state drop down box
var sel = $('#stateSel');
sel.append($('<option>', {value: '',text: '--'}));
// add options for all 50 states +D.C.
for (var sn = 0; sn < 51; sn++) {
sel.append($('<option>', {value: states[sn],text: states[sn]}));
}
// add options for miles
var sel2 = $('#distSel');
sel2.append($('<option>', {value: 'any',text: "any"}));
sel2.append($('<option>', {value: 5,text: "5"}));
sel2.append($('<option>', {value: 10,text: "10"}));
sel2.append($('<option>', {value: 20,text: "20"}));
sel2.append($('<option>', {value: 50,text: "50"}));
sel2.append($('<option>', {value: 100,text: "100"}));
sel2.append($('<option>', {value: 200,text: "200"}));
// action for "clear ", uncheck all visible checkboxes
$('#clrBtn').click(function () { $('#mySSTabBody input:checkbox:visible').prop('checked', false);});
// action for "select all", check all visible checkboxes
$('#allBtn').click(function () { $('#mySSTabBody input:checkbox:visible').prop('checked', true);});
// filter by state
$('#stateSel').change(function () {
$('#distSel').val('any');
var str = '';
var storeName, rowName, regStr;
// get the state string
$('#stateSel option:selected').each(function () {str += $(this).val();});
// interate over the stores to hide or display each row
for (var storeId in storeData) {
if (storeData.hasOwnProperty(storeId)) {
rowName = 'row__' + storeId;
if (str == '' || storeData[storeId].State == str) {
$('#' + rowName).css('display', 'table-row');
} else {
$('#' + rowName).css('display', 'none');
}
}
}
});
// filter by distance when zip input focus is lost
$("#zzipInput").focusout(function() {
$('#stateSel').val('');
filterByDistance();
});
// filter by distance when the distance selector is changed
$('#distSel').change(function () {
$('#stateSel').val('');
filterByDistance();
});
// apply the distance filter
function filterByDistance()
{
var filterDist;
var dist, rowName, regStr, lat1, lon1, lat2, lon2;
$('#distSel option:selected').each(function () { filterDist= $(this).val();});
if (filterDist == "any") {
// show everything for "any"
$('#mySSTabBody tr[id^="row__"]').each(function () {
$(this).css('display', 'table-row');
});
return;
}
var zip = Number($("#zzipInput").val());
// determine the zip code entered
if ( zip < 1 || zip > 99999) {
// not a number
return;
}
// put leading zeros
var pad = "00000";
zip = (pad+zip).slice(-pad.length);
//request zip code data using json
$.ajax({
url:'http://maps.googleapis.com/maps/api/geocode/json?address=' + zip,
type:"GET",
dataType: 'json',
async:'true',
success: function (data) {
my_debug(data);
if (!data.status || data.status != "OK") {
my_debug('failed to get zip');
return;
}
if (!data.results || !data.results[0] || !data.results[0].geometry) {
my_debug('Cannot get geometry data');
return;
}
$('#distSel option:selected').each(function () { filterDist= $(this).val();});
// get lat/lon in radians for the selected zip code
lat1 = data.results[0].geometry.location.lat;
lon1 = data.results[0].geometry.location.lng;
my_debug("Zip Lat/Lon: " + lat1 + "/" + lon1);
lat1 = lat1 * 3.14159/180.0;
lon1 = lon1 * 3.14159/180.0;
// get the distance string
$('#distSel option:selected').each(function () { filterDist= $(this).val();});
// interate over the stores to hide or display each row
for (var storeId in storeData)
{
if (storeData.hasOwnProperty(storeId))
{
if (filterDist != "any")
{
// get store lat/lon and convert to radians
lat2 = storeData[storeId].Lat;
lon2 = storeData[storeId].Lon;
my_debug("Store Lat/Lon: " + lat2 + "/" + lon2);
lat2 = lat2 * 3.14159/180.0;
lon2 = lon2 * 3.14159/180.0;
// determine distance in miles
dist = calcDist(lat1, lon1, lat2, lon2);
rowName = 'row__' + storeId;
// find all rows within the selected distance
if ( dist <= filterDist )
{
$('#' + rowName).css('display', 'table-row');
}
else
{
$('#' + rowName).css('display', 'none');
}
}
else
{
// show everything for "any"
rowName = 'row__' + storeId;
$('#' + rowName).css('display', 'table-row');
}
}
}
}
});
}
// build the options tab
$('#tabs-options').html(
'<div id="myOptDiv"></div> \
<div><table data-role="table" data-mode="columntoggle" style="min-width: 400px;" class="ui-responsive ui-shadow pc-tab" id="myOptTable"> \
<thead> \
<tr><th>Options</th></tr> \
</thead> \
<tbody id="myOptTabBody"> \
<tr><td><div style="text-align: left;"><input type="checkbox" id="hideInput" name="hideEmpty" ' + (options.hideEmpty ? "checked" : "" ) + ' /> Hide empty stores</div></td></tr> \
<tr><td><div style="text-align: left;"> Sort order: <select id="sortSel" style="margin-left: 1em; width: 10em;"> \
<option value="any" text="Any">Any</option>\
<option value="priceup" text="Price-Low to High">Price-Low to High</option>\
<option value="pricedown" text="Price-High to Low">Price-High to Low</option>\
<option value="qup" text="Quantity-Low to Hight">Quantity-Least to Most</option>\
<option value="qdown" text="Quantity-High to Low">Quantity-Most to Least</option></select></div></td></tr> \
<tr><td><div style="text-align: left;"> Requests per second: 1<input id="speedSel" type="range" min="1" max="10" step="1" value="5" style="width: 100px; vertical-align: middle;"/> 10</div></td></tr> \
<tr><td><div style="text-align: left;"><input type="checkbox" id="showStoreSearch" name="showStore" ' + (options.showStoreSearch ? "checked" : "" ) + ' /> Enable store searcher on info tab</div></td></tr> \
</tbody></table></div> \
<div id="myOptTableFooter" data-role="footer" style="font-size: 0.5em; width: 400px;"> \
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" >\
<img style="padding-top: 1em;" alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" />\
</a><br /><span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" property="dct:title" rel="dct:type">Lowes Price Checker</span> is licensed under a ' +
'<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a></div>');
// set the sort option and speed slider
$("#sortSel").val(options.sortSel);
$("#speedSel").val(options.speed || 8);
updateStoreSearch();
// filter by state when the pulldown is changed
$('#sortSel').change(function () {
options.sortSel = $("#sortSel :selected").val();
// save off the options
GM_setValue('options', JSON.stringify(options));
});
// set the message speed option when the slider is moved
$('#speedSel').change(function () {
options.speed = $("#speedSel").val();
// save off the options
GM_setValue('options', JSON.stringify(options));
});
// save the option to not make rows for stores with zero items
$('#hideInput').change(function () {
options.hideEmpty = $("#hideInput").prop('checked');
// save off the selected stores
GM_setValue('options', JSON.stringify(options));
});
// save the option to not make rows for stores with zero items
$('#showStoreSearch').change(function () {
options.showStoreSearch = $("#showStoreSearch").prop('checked');
// save off the selected stores
GM_setValue('options', JSON.stringify(options));
updateStoreSearch();
});
function updateStoreSearch() {
if (options.showStoreSearch) {
$("#storeSearcher").css('display', 'block');
} else {
$("#storeSearcher").css('display', 'none');
}
}
// determine the product ID
function getProductId() {
// scrape the product ID from the web page
try {
prodId = unsafeWindow.Lowes.ProductDetail.productId;
} catch (e) {
my_debug(e.message);
}
my_debug('Product id: ' + prodId);
}
// build a string with the brand + name of the product
function getProductName()
{
try {
// mobile
prodName = unsafeWindow.Lowes.ProductDetail.product.brand + ' ' + unsafeWindow.Lowes.ProductDetail.product.description;
} catch (e) {
my_debug(e.mesage);
}
try {
// www page
prodName = unsafeWindow.digitalData.products[0].brandName + " " + unsafeWindow.digitalData.products[0].productName;
prodName = prodName.replace(/\_/g, ' ');
} catch (e) {
my_debug(e.mesage);
}
my_debug('Product name: ' + prodName);
}
// create the store list table
function buildStoreTable() {
// start over
$('#mySSTabBody').empty();
// fill in the table
var useStore = false;
var loc = '';
// sort by store ID (numerical value)
var sorted_keys = Object.keys(storeData).sort(function(a, b){return a-b});
for (var i = 0 ; i < sorted_keys.length; i++) {
var storeId = sorted_keys[i];
if (storeData.hasOwnProperty(storeId)) {
try {
// get the store location
loc = storeData[storeId].Name + ", " + storeData[storeId].State;
// get the value for the checkbox
useStore = false;
if (searchStore.hasOwnProperty(storeId)) useStore = searchStore[storeId];
// create a row in the table
var storeAddr = "#" + storeId + ": " + storeData[storeId].Address + "; " + storeData[storeId].City + ", " + storeData[storeId].State + "; " + storeData[storeId].Zip;
var rowHTML = '<tr id=\'row__' + storeId + '\'><td><input type=\'checkbox\' name=\'store' + storeId + '\' value=\'use\' ' + (useStore ? 'checked' : '') + ' ></td><td>' + storeId + '</td><td class="lpc_addr" title="' + storeAddr +'">' + loc + '</td></tr>';
$(rowHTML).appendTo("#mySSTabBody");
} catch (err) {
my_debug(err.message);
}
}
}
}
// "Search" button was pressed. Start getting prices and quantities
function goAction() {
// create a button to export csv values
$("#myExportCSV").remove();
$('#myTableFooter').append("<button type='button' id='myExportCSV'>Export Results</button>");
getProductId();
$('#myExportCSV').click( function() {
my_debug('export');
var csvContent = 'Store, Quantity, Price, Shipping\n';
// iterate over the table
$("#myTabBody").children("tr").each( function() {
$(this).children("td").each( function() {
csvContent += '"' + $(this).text() + '",' ;
});
csvContent += "\n";
});
my_debug(csvContent);
var a = document.createElement('a');
if (a.download !== undefined ) {
a.href = 'data:attachment/csv, ' + encodeURIComponent(csvContent);
a.target = '_blank';
a.download = 'Lowes_' + prodId +'.csv';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
} else {
var encodedUri = encodeURI("data:text/csv;charset=utf-8," + csvContent);
window.open(encodedUri);
}
});
// display the main tab
$('#icDialog').tabs('option', 'active', 0);
// rebuild the list of stores to search based on the checkboxes
$('#mySSTabBody input:checkbox').each(function () {
var storeNum = '';
storeNum = /\d+/.exec($(this).attr('name'));
searchStore[storeNum] = $(this).prop('checked');
});
// save off the selected stores
GM_setValue('searchStore', JSON.stringify(searchStore));
// reset the results list
resHolder = {};
sortedRes = new Array();
// clear the table
$('#myTabBody').empty();
var msgNum = 0;
// determine how fast to send messages
var speed = options.speed || 8;
var millis = 1000 / speed;
// loop over the stores and request the product details for each store
for (var storeId in searchStore) {
if (searchStore.hasOwnProperty(storeId) && searchStore[storeId] &&
storeData.hasOwnProperty(storeId) ) {
// build the URL of the product details page w/ store ID
var qURL = baseURL + unsafeWindow.Lowes.ProductDetail.productPath + '/pricing/' + storeId;
my_debug(qURL);
// request the prodcut details. The result is processed by the function returned by the parseQty() function
setTimeout( function(url, sID) { return function() { $.get(url, parseQty(sID));}}(qURL,storeId), msgNum * millis);
msgNum++;
}
}
}
// get data on stores from Lowes.com
function findStores() {
var msgNum = 0;
// determine how fast to send messages
var speed = options.speed || 8;
var millis = 1000 / speed;
// check for stores with IDs from 1 to 5000 using the store locator
for (i = 1; i <= 5000; i++ ) {
var theURL = baseURL + "IntegrationServices/resources/storeLocator/json/v2_0/stores?place=" + i + "&count=1";
setTimeout( function(url) { return function() { $.get(url, parseStoreInfo());}}(theURL), msgNum * millis);
msgNum++;
}
}
// handle the return from the store locator call
var newStores = {};
function parseStoreInfo() {
return function (respObject) {
// if the return doesn't have a location, there is nothing to do
try {
var storeId = respObject.Location[0].KEY;
var so = respObject.Location[0];
var st = so.STATE;
// reject Canada results
if ( states.indexOf(st) < 0) return;
var newStore = {};
newStore.Name = so.STORENAME.replace(" Lowe\'s", "");
newStore.City = so.CITYFORMATTED;
newStore.State = so.STATE;
newStore.Zip = so.ZIP;
newStore.Lat = Number(Number(so.LLAT).toFixed(5));
newStore.Lon = Number(Number(so.LLON).toFixed(5));
newStore.Address = so.ADDRESS;
// store the data
newStores[storeId] = newStore;
// add to the display
$("#NS_DIV").html( JSON.stringify(newStores));
} catch (e) {
}
}
}
// Parse the data out of the response from the web call. Fill in the table with the results
function parseQty(storeId) {
// return this function to parse the return from the web call
return function (respObject) {
var sData;
// the data is stored in a javascript text block
try {
var re = /<script([\s\S]*?)<\/script>/m;
var pMatch = re.exec(respObject);
if (pMatch && pMatch.length >= 2) sData = pMatch[1];
} catch (e) {
my_debug(e);
}
var availStatus = 99999;
// find if shipping is available. undefined = "?"
var shipAvail = '';
// get the price out of the scripts values
var price;
try {
var re = new RegExp('sellingPrice="(.*?)"');
var pMatch = re.exec(sData);
if (pMatch && pMatch.length >= 2) price = pMatch[1];
} catch (e) {
my_debug(e);
}
// get the number in stock
try {
my_debug(sData);
var re = /"pickup":[\s\S]*?"availabileQuantity":(\d*)/m;
var pMatch = re.exec(sData);
my_debug(pMatch);
if (pMatch && pMatch.length >= 2) availStatus = pMatch[1];
} catch (e) {
my_debug(e);
}
// get the shipping status
try {
var re = new RegExp('"parcel":.*?"availabilityStatus":"(.*?)"');
var pMatch = re.exec(sData); console.log(pMatch);
if (pMatch && pMatch.length >= 2) shipAvail = (pMatch[1] === 'Available') ? 'Yes' : '';console.log((shipAvail === 'true'),shipAvail,pMatch);
} catch (e) {
my_debug(e);
}
if ( availStatus == "null" || availStatus == "undefined" || availStatus == 99999) availStatus =0;
price = parseFloat(price).toFixed(2);
my_debug('price: ' + price);
my_debug('number in store: ' + availStatus);
if (availStatus > 0 || !options.hideEmpty) {
// Creata a new row and add the data to the table
addResult(storeId, availStatus, price, shipAvail);
}
}
}
// create a row on the results table
function addResult(storeId, qty, price, shipping) {
// get the store name
var storeName = storeData[storeId].Name + ", " + storeData[storeId].State;
// put the store address in the title so it shows up in a tooltip
var storeAddr = "#" + storeId + ": " + storeData[storeId].Address + "; " + storeData[storeId].City + ", " + storeData[storeId].State + "; " + storeData[storeId].Zip;
// find where to put this result
var value = 0.0;
var direction = "up";
switch( options.sortSel ) {
case "any":
value = 0;
break;
case "priceup":
value = price;
direction = "up";
break;
case "pricedown":
value = price;
direction = "down";
break;
case "qup":
value = qty;
direction = "up";
break;
case "qdown":
value = qty;
direction = "down";
break;
}
if (isNaN(value)) value = 9999.0;
// add to array and sort
sortedRes.push(value);
if (direction == "up") {
sortedRes.sort(function(a, b){return a-b});
} else {
sortedRes.sort(function(a, b){return b-a});
}
// find where it landed
var ind = sortedRes.indexOf(value);
my_debug('qty: '+ qty);
// insert
var rowHTML = '<tr><td class="lpc_addr" title="' + storeAddr + '">' + storeName + '</td><td>' + qty + '</td><td>$' + price + '</td><td>' + shipping + '</td></tr>';
if (ind == 0) {
$(rowHTML).prependTo('#myTabBody');
} else if (ind >= sortedRes.length) {
// add to the end
$(rowHTML).appendTo('#myTabBody');
} else {
// add to the correct position
var rowBefore = $('#myTabBody').children('tr').get(ind-1);
$(rowHTML).insertAfter(rowBefore);
}
}
GM_registerMenuCommand("Price Check", showPopup);
function showPopup() {
$('#icDialog').dialog('open');
if (tableNodes) {
// reattach the table
$("#tabHolder").append(tableNodes);
}
var tab2 = $("#myTable").detach();
$("#tabHolder2").append(tab2);
$("#myTable").show();
tableNodes = null;
}
// Calculates point to point distance using the equirectangular projection approximation.
// This approximation isn't very accurate, but is fast.
// latitudes and longitudes are in radians
// the result is in miles
function calcDist(lat1, lon1, lat2, lon2) {
const R = 3959; // earth radius in miles
var x = (lon2-lon1) * Math.cos((lat1+lat2)/2);
var y = (lat2-lat1);
var d = Math.sqrt(x*x + y*y) * R;
return d;
}
})(jq_2) // end of "main". Call main and pass in jQuery object
function buildStoreList() {
// list of all the stores w/ name, state and zip code
storeData =
// Paste here =====================
{"1001":{"Name":"Victorville","City":"Victorville","State":"CA","Zip":"92392","Lat":34.46882,"Lon":-117.35076,"Address":"14333 Bear Valley Rd"},
"1003":{"Name":"Tampa Palms","City":"Tampa","State":"FL","Zip":"33647","Lat":28.11424,"Lon":-82.37996,"Address":"6201 Commerce Palms Dr"},
"1004":{"Name":"S. Myrtle Beach","City":"Myrtle Beach","State":"SC","Zip":"29588","Lat":33.64605,"Lon":-78.98684,"Address":"8672 Highway 17 Bypass"},
"1006":{"Name":"Richmond","City":"Richmond","State":"KY","Zip":"40475","Lat":37.72875,"Lon":-84.28575,"Address":"814 Eastern Bypass"},
"1008":{"Name":"Clinton Township","City":"Clinton Township","State":"MI","Zip":"48038","Lat":42.62586,"Lon":-82.9701,"Address":"15350 Hall Rd"},
"1010":{"Name":"Du Bois","City":"Du Bois","State":"PA","Zip":"15801","Lat":41.12568,"Lon":-78.72947,"Address":"100 Commons Dr"},
"1013":{"Name":"Mission Valley","City":"San Diego","State":"CA","Zip":"92108","Lat":32.78128,"Lon":-117.12595,"Address":"2318 Northside Dr"},
"1014":{"Name":"North Attleboro","City":"North Attleboro","State":"MA","Zip":"02760","Lat":41.93637,"Lon":-71.34649,"Address":"1360 S. Washington St"},
"1016":{"Name":"N.W. Macon","City":"Macon","State":"GA","Zip":"31210","Lat":32.88234,"Lon":-83.7626,"Address":"6011 Zebulon Rd"},
"1019":{"Name":"San Bruno","City":"San Bruno","State":"CA","Zip":"94066","Lat":37.64057,"Lon":-122.42081,"Address":"1340 El Camino Real"},
"1022":{"Name":"Watertown","City":"Watertown","State":"NY","Zip":"13601","Lat":43.97207,"Lon":-75.95788,"Address":"20828 New York State, Route 3 (arsenal Street)"},
"1023":{"Name":"Bedford Heights","City":"Bedford Heights","State":"OH","Zip":"44146","Lat":41.42238,"Lon":-81.50709,"Address":"24500 Miles Rd"},
"1024":{"Name":"Carson City","City":"Carson City","State":"NV","Zip":"89701","Lat":39.15088,"Lon":-119.76426,"Address":"430 Fairview Dr"},
"1026":{"Name":"Palm Springs","City":"Palm Springs","State":"CA","Zip":"92264","Lat":33.81467,"Lon":-116.49014,"Address":"5201 East Ramon Rd"},
"1030":{"Name":"Anaheim","City":"Anaheim","State":"CA","Zip":"92801","Lat":33.85593,"Lon":-117.91684,"Address":"1500 N. Lemon St"},
"1031":{"Name":"Anderson","City":"Anderson","State":"IN","Zip":"46013","Lat":40.08194,"Lon":-85.65397,"Address":"3335 South Scatterfield Rd"},
"1032":{"Name":"E. Chandler","City":"Chandler","State":"AZ","Zip":"85224","Lat":33.30754,"Lon":-111.8925,"Address":"2900 West Chandler Blvd"},
"1033":{"Name":"Henderson","City":"Henderson","State":"NV","Zip":"89014","Lat":36.05775,"Lon":-115.03576,"Address":"440 Marks St"},
"1034":{"Name":"Egg Harbor Township","City":"Egg Harbor Township","State":"NJ","Zip":"08234","Lat":39.43606,"Lon":-74.60952,"Address":"6048 Black Horse Pike"},
"1035":{"Name":"Holmdel","City":"Holmdel","State":"NJ","Zip":"07733","Lat":40.41426,"Lon":-74.1664,"Address":"2194 State Route 35"},
"1037":{"Name":"Central Richmond","City":"Richmond","State":"VA","Zip":"23220","Lat":37.55568,"Lon":-77.45672,"Address":"1640 West Broad St"},
"1038":{"Name":"Rockingham","City":"Rockingham","State":"NC","Zip":"28379","Lat":34.92055,"Lon":-79.75096,"Address":"1300-A East Broad Ave"},
"1040":{"Name":"Summersville","City":"Summersville","State":"WV","Zip":"26651","Lat":38.30875,"Lon":-80.8373,"Address":"5200 Webster Rd"},
"1041":{"Name":"Upland","City":"Upland","State":"CA","Zip":"91786","Lat":34.10933,"Lon":-117.68211,"Address":"1659 W. Foothill Blvd"},
"1042":{"Name":"W. Phoenix","City":"Phoenix","State":"AZ","Zip":"85035","Lat":33.46663,"Lon":-112.22285,"Address":"1620 North 75th Ave"},
"1043":{"Name":"Antioch","City":"Antioch","State":"CA","Zip":"94509","Lat":38.00502,"Lon":-121.83368,"Address":"1951 Auto Center Dr"},
"1045":{"Name":"Findlay","City":"Findlay","State":"OH","Zip":"45840","Lat":41.05726,"Lon":-83.60416,"Address":"1077 Bright Rd"},
"1046":{"Name":"Hamilton","City":"Hamilton","State":"NJ","Zip":"08691","Lat":40.19881,"Lon":-74.63512,"Address":"1000 Marketplace Blvd"},
"1047":{"Name":"Oaks","City":"Oaks","State":"PA","Zip":"19456","Lat":40.12927,"Lon":-75.45532,"Address":"200-B Mill Road"},
"1048":{"Name":"Riverside","City":"Riverside","State":"CA","Zip":"92503","Lat":33.91808,"Lon":-117.45407,"Address":"9851 Magnolia Ave"},
"1050":{"Name":"San Clemente","City":"San Clemente","State":"CA","Zip":"92673","Lat":33.45363,"Lon":-117.60912,"Address":"907 Avenida Pico"},
"1052":{"Name":"Tomball","City":"Tomball","State":"TX","Zip":"77377","Lat":30.0916,"Lon":-95.63741,"Address":"14236 Fm 2920"},
"1053":{"Name":"Pasadena","City":"Pasadena","State":"TX","Zip":"77505","Lat":29.64816,"Lon":-95.15914,"Address":"5400 Fairmont Pkwy"},
"1054":{"Name":"Metairie","City":"Metairie","State":"LA","Zip":"70002","Lat":30.00239,"Lon":-90.16322,"Address":"3640 Veterans Memorial Blvd"},
"1055":{"Name":"Fenton","City":"Fenton","State":"MO","Zip":"63026","Lat":38.5092,"Lon":-90.44604,"Address":"1 Gravois Bluffs Plaza Dr"},
"1057":{"Name":"St. Charles","City":"Saint Charles","State":"MO","Zip":"63301","Lat":38.78852,"Lon":-90.5307,"Address":"2900 West Clay St"},
"1058":{"Name":"Bunker Hill","City":"Houston","State":"TX","Zip":"77055","Lat":29.78617,"Lon":-95.52854,"Address":"9640 Old Katy Rd"},
"1059":{"Name":"Frisco","City":"Frisco","State":"TX","Zip":"75034","Lat":33.10648,"Lon":-96.80277,"Address":"3360 Preston Rd"},
"1060":{"Name":"S.W. Charlotte","City":"Charlotte","State":"NC","Zip":"28273","Lat":35.14574,"Lon":-80.93192,"Address":"8192 South Tryon St"},
"1064":{"Name":"S.E. Columbia","City":"Columbia","State":"SC","Zip":"29209","Lat":33.96376,"Lon":-80.93909,"Address":"7420 Garners Ferry Rd"},
"1065":{"Name":"Norfolk","City":"Norfolk","State":"VA","Zip":"23502","Lat":36.85789,"Lon":-76.21188,"Address":"1081 North Military Highway"},
"1066":{"Name":"Lexington","City":"Lexington","State":"SC","Zip":"29072","Lat":34.00161,"Lon":-81.21401,"Address":"5412 Sunset Blvd"},
"1067":{"Name":"Sedalia","City":"Sedalia","State":"MO","Zip":"65301","Lat":38.71115,"Lon":-93.27678,"Address":"3811 West Broadway"},
"1068":{"Name":"Shallotte","City":"Shallotte","State":"NC","Zip":"28470","Lat":33.97498,"Lon":-78.39959,"Address":"351 Whiteville Rd"},
"1069":{"Name":"W. Boca Raton","City":"Boca Raton","State":"FL","Zip":"33428","Lat":26.35149,"Lon":-80.20129,"Address":"21870 State Rd 7"},
"1070":{"Name":"Hammond","City":"Hammond","State":"LA","Zip":"70401","Lat":30.50265,"Lon":-90.49658,"Address":"3007 Highway 190 West"},
"1071":{"Name":"Highland Heights","City":"Highland Heights","State":"KY","Zip":"41076","Lat":39.03921,"Lon":-84.44749,"Address":"2369 Alexandria Pike"},
"1072":{"Name":"Galax","City":"Galax","State":"VA","Zip":"24333","Lat":36.69265,"Lon":-80.87457,"Address":"8417 Carrollton/Pike Rd"},
"1073":{"Name":"Gulf Breeze","City":"Gulf Breeze","State":"FL","Zip":"32563","Lat":30.38825,"Lon":-87.06337,"Address":"1421 Tiger Park Ln"},
"1074":{"Name":"Frenchtown Township","City":"Monroe","State":"MI","Zip":"48162","Lat":41.95436,"Lon":-83.40045,"Address":"2191 North Telegraph Rd"},
"1075":{"Name":"S. Florence","City":"Florence","State":"SC","Zip":"29505","Lat":34.15962,"Lon":-79.75833,"Address":"1701 Freedom Blvd"},
"1076":{"Name":"Conyers","City":"Conyers","State":"GA","Zip":"30013","Lat":33.63952,"Lon":-84.01904,"Address":"1901 Georgia Highway 138 S.E."},
"1077":{"Name":"Jefferson City","City":"Jefferson City","State":"MO","Zip":"65109","Lat":38.58029,"Lon":-92.24435,"Address":"3441 Missouri Blvd"},
"1078":{"Name":"N. Kansas City","City":"Kansas City","State":"MO","Zip":"64154","Lat":39.25096,"Lon":-94.65229,"Address":"8601 N. Boardwalk Ave"},
"1079":{"Name":"Winter Haven","City":"Winter Haven","State":"FL","Zip":"33880","Lat":28.01242,"Lon":-81.72954,"Address":"700 3rd St S.W. / 490 Citi Centre"},
"1080":{"Name":"Riverdale","City":"Riverdale","State":"UT","Zip":"84405","Lat":41.18861,"Lon":-111.98679,"Address":"4155 South Riverdale Rd"},
"1081":{"Name":"Lakewood","City":"Lakewood","State":"WA","Zip":"98499","Lat":47.1675,"Lon":-122.50447,"Address":"5115 100th St S.W. Lake"},
"1082":{"Name":"Yuma","City":"Yuma","State":"AZ","Zip":"85364","Lat":32.66806,"Lon":-114.62144,"Address":"115 West 32nd St"},
"1083":{"Name":"Rolla","City":"Rolla","State":"MO","Zip":"65401","Lat":37.96684,"Lon":-91.76233,"Address":"2300 North Bishop Ave"},
"1084":{"Name":"Shawnee","City":"Shawnee","State":"KS","Zip":"66217","Lat":39.01153,"Lon":-94.77518,"Address":"16300 West 65th St"},
"1085":{"Name":"Harvey","City":"Harvey","State":"LA","Zip":"70058","Lat":29.89667,"Lon":-90.05935,"Address":"1351 Manhattan Blvd"},
"1086":{"Name":"Modesto","City":"Modesto","State":"CA","Zip":"95356","Lat":37.70251,"Lon":-121.06475,"Address":"3801 Pelandale Ave"},
"1087":{"Name":"Folsom","City":"Folsom","State":"CA","Zip":"95630","Lat":38.67233,"Lon":-121.15752,"Address":"800 East Bidwell St"},
"1088":{"Name":"N.W. San Antonio","City":"San Antonio","State":"TX","Zip":"78250","Lat":29.54717,"Lon":-98.66599,"Address":"11333 Bandera Rd"},
"1089":{"Name":"Auburn","City":"Auburn","State":"WA","Zip":"98002","Lat":47.31939,"Lon":-122.22736,"Address":"1232 A Sreet Northeast"},
"1090":{"Name":"Gilbert","City":"Gilbert","State":"AZ","Zip":"85296","Lat":33.33649,"Lon":-111.79213,"Address":"734 South Gilbert Rd"},
"1091":{"Name":"Marion","City":"Marion","State":"OH","Zip":"43302","Lat":40.58382,"Lon":-83.07964,"Address":"1840 Marion Mt. Gilead Rd"},
"1092":{"Name":"Richmond","City":"Richmond","State":"IN","Zip":"47374","Lat":39.83091,"Lon":-84.81929,"Address":"510 West Eaton Pike"},
"1093":{"Name":"Muscle Shoals","City":"Muscle Shoals","State":"AL","Zip":"35661","Lat":34.72663,"Lon":-87.66605,"Address":"3415 Woodward Ave"},
"1094":{"Name":"Danvers","City":"Danvers","State":"MA","Zip":"01923","Lat":42.55895,"Lon":-70.96801,"Address":"153 Andover St"},
"1095":{"Name":"Knightdale","City":"Knightdale","State":"NC","Zip":"27545","Lat":35.79674,"Lon":-78.48398,"Address":"7316 Knightdale Blvd"},
"1096":{"Name":"Hollister","City":"Hollister","State":"MO","Zip":"65672","Lat":36.6142,"Lon":-93.22879,"Address":"165 Mall Rd"},
"1097":{"Name":"Morganton","City":"Morganton","State":"NC","Zip":"28655","Lat":35.71781,"Lon":-81.69691,"Address":"1224 Burkemont Ave"},
"1098":{"Name":"Independence","City":"Independence","State":"MO","Zip":"64055","Lat":39.03479,"Lon":-94.35931,"Address":"19000 East Valley View Pkwy"},
"1099":{"Name":"E. Colorado Springs","City":"Colorado Springs","State":"CO","Zip":"80922","Lat":38.87388,"Lon":-104.71794,"Address":"2945 New Center Pt"},
"1105":{"Name":"N. Ft Wayne","City":"Fort Wayne","State":"IN","Zip":"46818","Lat":41.14076,"Lon":-85.16547,"Address":"6931 North Lima Rd"},
"1106":{"Name":"North Bergen","City":"North Bergen","State":"NJ","Zip":"07047","Lat":40.80627,"Lon":-74.01873,"Address":"7801 Tonnelle Ave"},
"1107":{"Name":"New Iberia","City":"New Iberia","State":"LA","Zip":"70560","Lat":29.98688,"Lon":-91.85444,"Address":"2816 Highway 14"},
"1108":{"Name":"Tigard","City":"Tigard","State":"OR","Zip":"97223","Lat":45.42851,"Lon":-122.75329,"Address":"12615 S.W. 72nd Ave"},
"1109":{"Name":"Stuart","City":"Stuart","State":"FL","Zip":"34997","Lat":27.1602,"Lon":-80.22533,"Address":"3620 Southeast Federal Highway"},
"1110":{"Name":"Portage","City":"Portage","State":"MI","Zip":"49002","Lat":42.24317,"Lon":-85.59242,"Address":"5108 South Westnedge Ave"},
"1111":{"Name":"Boynton Beach","City":"Boynton Beach","State":"FL","Zip":"33426","Lat":26.51319,"Lon":-80.07602,"Address":"1500 Corporate Dr"},
"1112":{"Name":"S. Charlotte","City":"Charlotte","State":"NC","Zip":"28277","Lat":35.06565,"Lon":-80.77371,"Address":"5310 Ballantyne Commons Pkwy"},
"1113":{"Name":"Sunrise","City":"Sunrise","State":"FL","Zip":"33351","Lat":26.16571,"Lon":-80.25772,"Address":"8050 West Oakland Park Blvd"},
"1114":{"Name":"Wood Village","City":"Wood Village","State":"OR","Zip":"97060","Lat":45.52989,"Lon":-122.42545,"Address":"1000 Ne Wood Village Blvd"},
"1115":{"Name":"Guntersville","City":"Guntersville","State":"AL","Zip":"35976","Lat":34.29986,"Lon":-86.26792,"Address":"11190 U.S. Highway 431 South"},
"1116":{"Name":"S.W. Augusta","City":"Augusta","State":"GA","Zip":"30906","Lat":33.40766,"Lon":-82.02408,"Address":"3214 Peach Orchard Rd"},
"1117":{"Name":"Peoria","City":"Peoria","State":"AZ","Zip":"85381","Lat":33.60852,"Lon":-112.24154,"Address":"8497 West Thunderbird Rd"},
"1118":{"Name":"St. George","City":"Saint George","State":"UT","Zip":"84790","Lat":37.1008,"Lon":-113.55402,"Address":"415 South River Rd"},
"1119":{"Name":"Chamblee","City":"Chamblee","State":"GA","Zip":"30341","Lat":33.88522,"Lon":-84.31734,"Address":"4950 Peachtree Industrial Blvd"},
"1120":{"Name":"Florence","City":"Florence","State":"SC","Zip":"29501","Lat":34.18882,"Lon":-79.81908,"Address":"2301 David H. Mcleod Blvd"},