update keyword
This commit is contained in:
parent
3381e8ce48
commit
abc194cd2f
|
|
@ -1,3 +1,3 @@
|
||||||
node_modules
|
node_modules
|
||||||
.env
|
.env
|
||||||
data
|
*/*.db
|
||||||
|
|
@ -0,0 +1,165 @@
|
||||||
|
M321R8GA0BB0-CQK | "Samsung" "64GB" "2Rx4" "4800" "RDIMM"| 1425
|
||||||
|
HMCG94AGBQA181N | "Hynix" "64GB" "2Rx4" "5600" "RDIMM"| 1425
|
||||||
|
MTC40F2046S1RC56BG1 | "Micron" "64GB" "2Rx4" "5600" "RDIMM"| 1325
|
||||||
|
HMCG94AGBRA181N | "Hynix" "64GB" "2Rx4" "5600" "RDIMM"| 1425
|
||||||
|
M321R8GA0EB2-CCP | "Samsung" "64GB" "2Rx4" "6400" "RDIMM"| 1570
|
||||||
|
HMCG84MEBRA17N | "Hynix" "32GB" "1Rx4" "4800" "RDIMM"| 640
|
||||||
|
M321R4GA3BB0-CQK | "Samsung" "32GB" "2Rx8" "4800" "RDIMM"| 985
|
||||||
|
M321R4GA3BB6-CQK | "Samsung" "32GB" "2Rx8" "4800" "RDIMM"| 640
|
||||||
|
MTC20F2085S1RC52BAW | "Micron" "32GB" "2Rx8" "5200" "RDIMM"| 570
|
||||||
|
M321R4GA3PB0-CWM | "Samsung" "32GB" "2Rx8" "5600" "RDIMM"| 740
|
||||||
|
HMCG88AGBRA191N-BB | "Hynix" "32GB" "2Rx8" "5600" "RDIMM"| 715
|
||||||
|
HMCG88AGBRA190N | "Hynix" "32GB" "2Rx8" "5600" "RDIMM"| 715
|
||||||
|
M321R4GA0EB2-CCP | "Samsung" "32GB" "1Rx4" "6400" "RDIMM"| 715
|
||||||
|
M321R2GA3BB0-CQK | "Samsung" "16GB" "1Rx8" "4800" "RDIMM"| 315
|
||||||
|
MTC10F1084S1RC48BA1 | "Micron" "16GB" "1Rx8" "4800" "RDIMM"| 285
|
||||||
|
M386AAK40B40-CWD | "Samsung" "128GB" "2S4Rx4" "2666" "LRDIMM"| 530
|
||||||
|
M393AAG40M3B-CYF | "Samsung" "128GB" "2S2Rx4" "2933" "LRDIMM"| 580
|
||||||
|
HMABAGL7ABR4N-XN | "Hynix" "128GB" "4DRx4" "3200" "LRDIMM"| 470
|
||||||
|
M386A8K40BM1-CRC | "Samsung" "64GB" "4DRx4" "2400" "LRDIMM"| 287.36
|
||||||
|
M386A8K40BMB-CRC | "Samsung" "64GB" "4DRx4" "2400" "LRDIMM"| 287.36
|
||||||
|
HMAA8GL7MMR4N-UH | "Hynix" "64GB" "4DRx4" "2400" "LRDIMM"| 284.9
|
||||||
|
MTA72ASS8G72LZ-2G3 | "Micron" "64GB" "4DRx4" "2400" "LRDIMM"| 240
|
||||||
|
M386A8K40DM2-CTD | "Samsung" "64GB" "4DRx4" "2666" "LRDIMM"| 428
|
||||||
|
M386A8K40BM2-CTD | "Samsung" "64GB" "4DRx4" "2666" "LRDIMM"| 420.5
|
||||||
|
M393A8K40B22-CWD | "Samsung" "64GB" "2S2Rx4" "2666" "LRDIMM"| 400
|
||||||
|
M386A8K40CM2-CTD | "Samsung" "64GB" "4DRx4" "2666" "LRDIMM"| 428
|
||||||
|
HMAA8GL7MMR4N-VK | "Hynix" "64GB" "4DRx4" "2666" "LRDIMM"| 334.3
|
||||||
|
HMAA8GL7CPR4N-VK | "Hynix" "64GB" "4DRx4" "2666" "LRDIMM"| 334.3
|
||||||
|
M386A8K40DM2-CVF | "Samsung" "64GB" "4DRx4" "2933" "LRDIMM"| 552.33
|
||||||
|
HMAA8GL7CPR4N-WM | "Hynix" "64GB" "4DRx4" "2933" "LRDIMM"| 558
|
||||||
|
MTA72ASS8G72LZ-2G9 | "Micron" "64GB" "4DRx4" "2933" "LRDIMM"| 539
|
||||||
|
M393A8G40AB2-CVF | "Samsung" "64GB" "2Rx4" "2933" "RDIMM"| 605
|
||||||
|
M393A8G40MB2-CVF | "Samsung" "64GB" "2Rx4" "2933" "RDIMM"| 512
|
||||||
|
HMAA8GR7AJR4N-WM | "Hynix" "64GB" "2Rx4" "2933" "RDIMM"| 750.5
|
||||||
|
HMAA8GR7MJR4N-WM | "Hynix" "64GB" "2Rx4" "2933" "RDIMM"| 536
|
||||||
|
MTA36ASF8G72PZ-2G9 | "Micron" "64GB" "2Rx4" "2933" "RDIMM"| 595
|
||||||
|
M393A8G40AB2-CWE | "Samsung" "64GB" "2Rx4" "3200" "RDIMM"| 872
|
||||||
|
M393A8G40MB2-CWE | "Samsung" "64GB" "2Rx4" "3200" "RDIMM"| 760
|
||||||
|
M393A8G40CB4-CWE | "Samsung" "64GB" "2Rx4" "3200" "RDIMM"| 740
|
||||||
|
HMAA8GR7AJR4N-XN | "Hynix" "64GB" "2Rx4" "3200" "RDIMM"| 600
|
||||||
|
HMAA8GR7CJR4N-XN | "Hynix" "64GB" "2Rx4" "3200" "RDIMM"| 836
|
||||||
|
M386B4G70DM0-YH9 | "Samsung" "32GB" "4Rx4" "1333" "LRDIMM"| 28.37
|
||||||
|
M386B4G70DM0-YK | "Samsung" "32GB" "4DRx4" "1600" "LRDIMM"| 28.37
|
||||||
|
HMA84GL7AMR4N-TF | "Hynix" "32GB" "4DRx4" "2133" "LRDIMM"| 123.5
|
||||||
|
MTA72ASS4G72LZ-2G1 | "Micron" "32GB" "4DRx4" "2133" "LRDIMM"| 92.59
|
||||||
|
M386A4G40DM0-CPB | "Samsung" "32GB" "4DRx4" "2133" "LRDIMM"| 152
|
||||||
|
M386A4G40DM1-CRC | "Samsung" "32GB" "4DRx4" "2400" "LRDIMM"| 156.75
|
||||||
|
M393A4K40BB0-CPB | "Samsung" "32GB" "2Rx4" "2133" "RDIMM"| 207
|
||||||
|
HMA84GR7MFR4N-TF | "Hynix" "32GB" "2Rx4" "2133" "RDIMM"| 174.17
|
||||||
|
MTA36ASF4G72PZ-2G1 | "Micron" "32GB" "2Rx4" "2133" "RDIMM"| 133
|
||||||
|
M386A4K40BB0-CRC | "Samsung" "32GB" "2Rx4" "2400" "LRDIMM"| 172.56
|
||||||
|
M393A4K40BB1-CRC | "Samsung" "32GB" "2Rx4" "2400" "RDIMM"| 251
|
||||||
|
M393A4K40CB1-CRC | "Samsung" "32GB" "2Rx4" "2400" "RDIMM"| 251
|
||||||
|
HMA84GR7MFR4N-UH | "Hynix" "32GB" "2Rx4" "2400" "RDIMM"| 207
|
||||||
|
HMA84GR7AFR4N-UH | "Hynix" "32GB" "2Rx4" "2400" "RDIMM"| 181.16
|
||||||
|
HMA84GL7MFR4N-UH | "Hynix" "32GB" "2Rx4" "2400" "RDIMM"| 181.16
|
||||||
|
MTA36ASF4G72PZ-2G3 | "Micron" "32GB" "2Rx4" "2400" "RDIMM"| 192.85
|
||||||
|
M393A4K40BB2-CTD | "Samsung" "32GB" "2Rx4" "2666" "RDIMM"| 280
|
||||||
|
M393A4K40CB2-CTD | "Samsung" "32GB" "2Rx4" "2666" "RDIMM"| 266
|
||||||
|
HMA84GR7CJR4N-VK | "Hynix" "32GB" "2Rx4" "2666" "RDIMM"| 248
|
||||||
|
HMA84GR7AFR4N-VK | "Hynix" "32GB" "2Rx4" "2666" "RDIMM"| 248
|
||||||
|
HMA84GR7JJR4N-VK | "Hynix" "32GB" "2Rx4" "2666" "RDIMM"| 248
|
||||||
|
MTA36ASF4G72PZ-2G6 | "Micron" "32GB" "2Rx4" "2666" "RDIMM"| 213
|
||||||
|
MTA36ASF4G72LZ-2G6 | "Micron" "32GB" "2Rx4" "2666" "RDIMM"| 213
|
||||||
|
M393A4K40DB2-CVF | "Samsung" "32GB" "2Rx4" "2933" "RDIMM"| 228
|
||||||
|
M393A4K40CB2-CVF | "Samsung" "32GB" "2Rx4" "2933" "RDIMM"| 380
|
||||||
|
HMA84GR7JJR4N-WM | "Hynix" "32GB" "2Rx4" "2933" "RDIMM"| 413
|
||||||
|
HMA84GR7DJR4N-WM | "Hynix" "32GB" "2Rx4" "2933" "RDIMM"| 413
|
||||||
|
HMA84GR7CJR4N-WM | "Hynix" "32GB" "2Rx4" "2933" "RDIMM"| 413
|
||||||
|
MTA36ASF4G72PZ-2G9 | "Micron" "32GB" "2Rx4" "2933" "RDIMM"| 302.82
|
||||||
|
M393A4G40BB3-CWE | "Samsung" "32GB" "1Rx4" "3200" "RDIMM"| 436.05
|
||||||
|
M393A4K40EB3-CWE | "Samsung" "32GB" "2Rx4" "3200" "RDIMM"| 503
|
||||||
|
M393A4K40DB3-CWE | "Samsung" "32GB" "2Rx4" "3200" "RDIMM"| 503
|
||||||
|
HMA84GR7CJR4N-XN | "Hynix" "32GB" "2Rx4" "3200" "RDIMM"| 475
|
||||||
|
HMA84GR7DJR4N-XN | "Hynix" "32GB" "2Rx4" "3200" "RDIMM"| 475
|
||||||
|
MTA36ASF4G72PZ-3G2 | "Micron" "32GB" "2Rx4" "3200" "RDIMM"| 361
|
||||||
|
M393A4G43AB3-CWE | "Samsung" "32GB" "2Rx8" "3200" "RDIMM"| 425
|
||||||
|
HMAA4GR7CJR8N-XN | "Hynix" "32GB" "2Rx8" "3200" "RDIMM"| 362.32
|
||||||
|
HMT42GR7BMR4C-G7 | "Hynix" "16GB" "4Rx4" "1066" "RDIMM"| 21.13
|
||||||
|
MT36KSF2G72PZ-1G4 | "Micron" "16GB" "2Rx4" "1333" "RDIMM"| 16.88
|
||||||
|
M393B2G70EB0-YK0 | "Samsung" "16GB" "2Rx4" "1600" "RDIMM"| 19.69
|
||||||
|
M393B2G70DB0-YK0 | "Samsung" "16GB" "2Rx4" "1600" "RDIMM"| 19.69
|
||||||
|
M393B2G70BH0-YK0 | "Samsung" "16GB" "2Rx4" "1600" "RDIMM"| 19.69
|
||||||
|
MT36KSF2G72PZ-1G6 | "Micron" "16GB" "2Rx4" "1600" "RDIMM"| 21.4
|
||||||
|
HMT42GR7BFR4A-PB | "Hynix" "16GB" "2Rx4" "1600" "RDIMM"| 19.69
|
||||||
|
HMT42GR7MFR4C-PB | "Hynix" "16GB" "2Rx4" "1600" "RDIMM"| 18.99
|
||||||
|
HMT42GR7AFR4C-RD | "Hynix" "16GB" "2Rx4" "1866" "RDIMM"| 17.02
|
||||||
|
M393A2G40EB1-CPB | "Samsung" "16GB" "2Rx4" "2133" "RDIMM"| 110.4
|
||||||
|
M393A2G40DB0-CPB | "Samsung" "16GB" "2Rx4" "2133" "RDIMM"| 110.4
|
||||||
|
HMA42GR7AFR4N-TF | "Hynix" "16GB" "2Rx4" "2133" "RDIMM"| 97.7
|
||||||
|
HMA42GR7MFR4N-TF | "Hynix" "16GB" "2Rx4" "2133" "RDIMM"| 60
|
||||||
|
MTA36ASF2G72PZ-2G1 | "Micron" "16GB" "2Rx4" "2133" "RDIMM"| 64.4
|
||||||
|
M393A2K40CB1-CRC | "Samsung" "16GB" "1Rx4" "2400" "RDIMM"| 10
|
||||||
|
M393A2K40BB1-CRC | "Samsung" "16GB" "1Rx4" "2400" "RDIMM"| 110
|
||||||
|
MTA18ASF2G72PZ-2G3 | "Micron" "16GB" "1Rx4" "2400" "RDIMM"| 95
|
||||||
|
M393A2G40EB1-CRC | "Samsung" "16GB" "2Rx4" "2400" "RDIMM"| 110.2
|
||||||
|
HMA42GR7AFR4N-UH | "Hynix" "16GB" "2Rx4" "2400" "RDIMM"| 108
|
||||||
|
HMA42GR7BJR4N-UH | "Hynix" "16GB" "2Rx4" "2400" "RDIMM"| 108
|
||||||
|
MTA36ASF2G72PZ-2G3 | "Micron" "16GB" "2Rx4" "2400" "RDIMM"| 85
|
||||||
|
HMA82GR7AFR4N-VK | "Hynix" "16GB" "1Rx4" "2666" "RDIMM"| 110
|
||||||
|
HMA82GR7CJR4N-VK | "Hynix" "16GB" "1Rx4" "2666" "RDIMM"| 110
|
||||||
|
M393A2K43BB1-CTD | "Samsung" "16GB" "2Rx8" "2666" "RDIMM"| 114.29
|
||||||
|
HMA82GR7AFR8N-VK | "Hynix" "16GB" "2Rx8" "2666" "RDIMM"| 107
|
||||||
|
HMA82GR7CJR8N-VK | "Hynix" "16GB" "2Rx8" "2666" "RDIMM"| 107
|
||||||
|
HMA82GR7JJR8N-VK | "Hynix" "16GB" "2Rx8" "2666" "RDIMM"| 107
|
||||||
|
MTA18ASF2G72PDZ-2G6 | "Micron" "16GB" "2Rx8" "2666" "RDIMM"| 83.33
|
||||||
|
M393A2K40CB2-CVF | "Samsung" "16GB" "1Rx4" "2933" "RDIMM"| 118.75
|
||||||
|
M393A2K40DB2-CVF | "Samsung" "16GB" "1Rx4" "2933" "RDIMM"| 118.75
|
||||||
|
M393A2K43DB2-CVF | "Samsung" "16GB" "2Rx8" "2933" "RDIMM"| 100.57
|
||||||
|
HMA82GR7CJR8N-WM | "Hynix" "16GB" "2Rx8" "2933" "RDIMM"| 78.65
|
||||||
|
HMA82GR7JJR8N-WM | "Hynix" "16GB" "2Rx8" "2933" "RDIMM"| 102.56
|
||||||
|
M393A2K43DB3-CWE | "Samsung" "16GB" "2Rx8" "3200" "RDIMM"| 171
|
||||||
|
HMA82GR7DJR8N-XN | "Hynix" "16GB" "2Rx8" "3200" "RDIMM"| 114.29
|
||||||
|
HMA82GR7CJR8N-XN | "Hynix" "16GB" "2Rx8" "3200" "RDIMM"| 114.29
|
||||||
|
MTA18ASF2G72PDZ-3G2 | "Micron" "16GB" "2Rx8" "3200" "RDIMM"| 85.47
|
||||||
|
M393B1K70DH0-YH9 | "Samsung" "8GB" "2Rx4" "1333" "RDIMM"| 6.05
|
||||||
|
M393B1K70CH0-CH9 | "Samsung" "8GB" "2Rx4" "1333" "RDIMM"| 6.05
|
||||||
|
MTA18ASF1G72PZ-2G1 | "Micron" "8GB" "1Rx4" "2133" "RDIMM"| 23.98
|
||||||
|
HMA41GR7AFR8N-TF | "Hynix" "8GB" "1Rx8" "2133" "RDIMM"| 30.24
|
||||||
|
M393A1G40DB0-CPB | "Samsung" "8GB" "1Rx8" "2133" "RDIMM"| 45
|
||||||
|
MTA18ASF1G72PZ-2G1 | "Micron" "8GB" "1Rx8" "2133" "RDIMM"| 23.91
|
||||||
|
HMA41GR7AFR8N-TF | "Hynix" "8GB" "2Rx8" "2133" "RDIMM"| 28.13
|
||||||
|
M393A1G43DB0-CPB | "Samsung" "8GB" "2Rx8" "2133" "RDIMM"| 28.13
|
||||||
|
MTA18ASF1G72PZ-2G1 | "Micron" "8GB" "2Rx8" "2133" "RDIMM"| 23.91
|
||||||
|
HMA41GR7AFR4N-UH | "Hynix" "8GB" "1Rx4" "2400" "RDIMM"| 28
|
||||||
|
HMA81GR7MFR8N-UH | "Hynix" "8GB" "1Rx8" "2400" "RDIMM"| 30.24
|
||||||
|
M393A1G40DB1-CRC | "Samsung" "8GB" "1Rx8" "2400" "RDIMM"| 30.24
|
||||||
|
MTA9ASF1G72PZ-2G3 | "Micron" "8GB" "1Rx8" "2400" "RDIMM"| 30.24
|
||||||
|
HMA41GR7AFR8N-UH | "Hynix" "8GB" "2Rx8" "2400" "RDIMM"| 39.6
|
||||||
|
M393A1G40DB1-CRC | "Samsung" "8GB" "2Rx8" "2400" "RDIMM"| 28.13
|
||||||
|
M393A1G43DB1-CRC | "Samsung" "8GB" "2Rx8" "2400" "RDIMM"| 39.6
|
||||||
|
MTA18ASF1G72PDZ-2G3 | "Micron" "8GB" "2Rx8" "2400" "RDIMM"| 28.13
|
||||||
|
HMA81GR7AFR8N-VK | "Hynix" "8GB" "1Rx8" "2666" "RDIMM"| 28.6
|
||||||
|
MTA9ASF1G72PZ-2G6 | "Micron" "8GB" "1Rx8" "2666" "RDIMM"| 28.6
|
||||||
|
HMA81GR7AFR8N-VK | "Hynix" "8GB" "2Rx8" "2666" "RDIMM"| 28.13
|
||||||
|
MTA9ASF1G72PZ-2G6 | "Micron" "8GB" "2Rx8" "2666" "RDIMM"| 28.13
|
||||||
|
HMA81GR7CJR8N-WM | "Hynix" "8GB" "1Rx8" "2933" "RDIMM"| 39.33
|
||||||
|
HMA81GR7CJR8N-WM | "Hynix" "8GB" "2Rx8" "2933" "RDIMM"| 41.49
|
||||||
|
M393A1K43DB1-CVF | "Samsung" "8GB" "2Rx8" "2933" "RDIMM"| 41.49
|
||||||
|
MTA9ASF1G72PZ-2G9 | "Micron" "8GB" "2Rx8" "2933" "RDIMM"| 30.24
|
||||||
|
HMA81GR7CJR8N-XN | "Hynix" "8GB" "1Rx8" "3200" "RDIMM"| 61.6
|
||||||
|
MTA9ASF1G72PZ-3G2 | "Micron" "8GB" "1Rx8" "3200" "RDIMM"| 30.24
|
||||||
|
HMA81GR7CJR8N-XN | "Hynix" "8GB" "2Rx8" "3200" "RDIMM"| 41.49
|
||||||
|
"" | "Samsung" "32GB" "2Rx8" "2133" "UDIMM"| 127.5
|
||||||
|
"" | "Samsung" "32GB" "2Rx8" "2400" "UDIMM"| 140
|
||||||
|
M378A4G43MB1-CTD | "Samsung" "32GB" "2Rx8" "2666" "UDIMM"| 164
|
||||||
|
M378A4G43AB2-CVF | "Samsung" "32GB" "2Rx8" "2933" "UDIMM"| 137.88
|
||||||
|
M378A4G43AB2-CWE | "Samsung" "32GB" "2Rx8" "3200" "UDIMM"| 180
|
||||||
|
HMAA4GU6AJR8N-XN | "Hynix" "32GB" "2Rx8" "3200" "UDIMM"| 242.25
|
||||||
|
M378A2K43BB1-CPB | "Samsung" "16GB" "2Rx8" "2133" "UDIMM"| 56.5
|
||||||
|
M378A2K43CB1-CRC | "Samsung" "16GB" "2Rx8" "2400" "UDIMM"| 110
|
||||||
|
MTA18ASF2G72AZ-2G3 | "Micron" "16GB" "2Rx8" "2400" "UDIMM"| 90.25
|
||||||
|
HMA82GU6JJR8N-VK | "Hynix" "16GB" "2Rx8" "2666" "UDIMM"| 90
|
||||||
|
M378A2K43DB1-CVF | "Samsung" "16GB" "2Rx8" "2933" "UDIMM"| 56.5
|
||||||
|
KVR32N22S8/16 | "Kingston" "16GB" "1RX8" "3200" "UDIMM"| 48.5
|
||||||
|
M378A1K43BB1-CPB | "Samsung" "8GB" "1RX8" "2133" "UDIMM"| 25
|
||||||
|
M378A1K43CB2-CRC | "Samsung" "8GB" "1RX8" "2400" "UDIMM"| 30
|
||||||
|
M474A2K43BB1-CRC | "Samsung" "16GB" "2Rx8" "2400" "SODIMM"| 90
|
||||||
|
HMAA2GS6CJR8N-XN | "Hynix" "16GB" "1Rx8" "3200" "SODIMM"| 72.67
|
||||||
|
M474A2K43EB1-CWE | "Samsung" "16GB" "2Rx8" "3200" "SODIMM"| 80
|
||||||
|
M471A4G43MB1-CTD | "Samsung" "32GB" "2Rx8" "2666" "SODIMM"| 125
|
||||||
|
M471A4G43BB1-CWE | "Samsung" "32GB" "2Rx8" "3200" "SODIMM"| 139.4
|
||||||
|
HMAA4GS6CJR8N | "Hynix" "32GB" "2Rx8" "3200" "SODIMM"| 123.55
|
||||||
|
M425R2GA3BB0-CWM | "Samsung" "16GB" "1Rx8" "5600" "SODIMM"| 130.62
|
||||||
|
M425R4GA3PB0-CWM | "Samsung" "32GB" "2Rx8" "5600" "SODIMM"| 246.73
|
||||||
19
db.js
19
db.js
|
|
@ -17,6 +17,7 @@ function initDb() {
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
name TEXT NOT NULL,
|
name TEXT NOT NULL,
|
||||||
price_ratio REAL DEFAULT 0.85,
|
price_ratio REAL DEFAULT 0.85,
|
||||||
|
common_keywords TEXT,
|
||||||
last_scan_time DATETIME,
|
last_scan_time DATETIME,
|
||||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||||
);
|
);
|
||||||
|
|
@ -67,6 +68,16 @@ function initDb() {
|
||||||
|
|
||||||
// Migration: Add columns if they don't exist
|
// Migration: Add columns if they don't exist
|
||||||
try { db.exec("ALTER TABLE profiles ADD COLUMN last_scan_time DATETIME;"); } catch(e){}
|
try { db.exec("ALTER TABLE profiles ADD COLUMN last_scan_time DATETIME;"); } catch(e){}
|
||||||
|
try { db.exec("ALTER TABLE profiles ADD COLUMN common_keywords TEXT;"); } catch(e){}
|
||||||
|
// Migration: rename ignore_keywords to common_keywords if it exists
|
||||||
|
try {
|
||||||
|
const tableInfo = db.prepare("PRAGMA table_info(profiles)").all();
|
||||||
|
const hasIgnore = tableInfo.some(col => col.name === 'ignore_keywords');
|
||||||
|
const hasCommon = tableInfo.some(col => col.name === 'common_keywords');
|
||||||
|
if (hasIgnore && !hasCommon) {
|
||||||
|
db.exec("ALTER TABLE profiles RENAME COLUMN ignore_keywords TO common_keywords");
|
||||||
|
}
|
||||||
|
} catch(e){}
|
||||||
try { db.exec("ALTER TABLE items ADD COLUMN profile_id INTEGER;"); } catch(e){}
|
try { db.exec("ALTER TABLE items ADD COLUMN profile_id INTEGER;"); } catch(e){}
|
||||||
try { db.exec("ALTER TABLE items ADD COLUMN keyword_id INTEGER;"); } catch(e){}
|
try { db.exec("ALTER TABLE items ADD COLUMN keyword_id INTEGER;"); } catch(e){}
|
||||||
}
|
}
|
||||||
|
|
@ -77,9 +88,9 @@ const stmts = {
|
||||||
// Profiles
|
// Profiles
|
||||||
getProfiles: db.prepare('SELECT * FROM profiles ORDER BY name'),
|
getProfiles: db.prepare('SELECT * FROM profiles ORDER BY name'),
|
||||||
getProfile: db.prepare('SELECT * FROM profiles WHERE id = ?'),
|
getProfile: db.prepare('SELECT * FROM profiles WHERE id = ?'),
|
||||||
insertProfile: db.prepare('INSERT INTO profiles (name, price_ratio) VALUES (?, ?)'),
|
insertProfile: db.prepare('INSERT INTO profiles (name, price_ratio, common_keywords) VALUES (?, ?, ?)'),
|
||||||
deleteProfile: db.prepare('DELETE FROM profiles WHERE id = ?'),
|
deleteProfile: db.prepare('DELETE FROM profiles WHERE id = ?'),
|
||||||
updateProfile: db.prepare('UPDATE profiles SET name = ?, price_ratio = ? WHERE id = ?'),
|
updateProfile: db.prepare('UPDATE profiles SET name = ?, price_ratio = ?, common_keywords = ? WHERE id = ?'),
|
||||||
updateProfileScanTime: db.prepare('UPDATE profiles SET last_scan_time = CURRENT_TIMESTAMP WHERE id = ?'),
|
updateProfileScanTime: db.prepare('UPDATE profiles SET last_scan_time = CURRENT_TIMESTAMP WHERE id = ?'),
|
||||||
|
|
||||||
// Search Keywords
|
// Search Keywords
|
||||||
|
|
@ -160,9 +171,9 @@ module.exports = {
|
||||||
// Profiles
|
// Profiles
|
||||||
getProfiles() { return stmts.getProfiles.all(); },
|
getProfiles() { return stmts.getProfiles.all(); },
|
||||||
getProfile(id) { return stmts.getProfile.get(id); },
|
getProfile(id) { return stmts.getProfile.get(id); },
|
||||||
addProfile(name, ratio) { return stmts.insertProfile.run(name, ratio); },
|
addProfile(name, ratio, commonKeywords) { return stmts.insertProfile.run(name, ratio, commonKeywords); },
|
||||||
deleteProfile(id) { return stmts.deleteProfile.run(id); },
|
deleteProfile(id) { return stmts.deleteProfile.run(id); },
|
||||||
updateProfile(id, name, ratio) { return stmts.updateProfile.run(name, ratio, id); },
|
updateProfile(id, name, ratio, commonKeywords) { return stmts.updateProfile.run(name, ratio, commonKeywords, id); },
|
||||||
updateProfileScanTime(id) { return stmts.updateProfileScanTime.run(id); },
|
updateProfileScanTime(id) { return stmts.updateProfileScanTime.run(id); },
|
||||||
|
|
||||||
// Keywords
|
// Keywords
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@
|
||||||
|
|
||||||
<h3 style="margin-bottom: 1rem; font-size: 1rem">Create New Profile</h3>
|
<h3 style="margin-bottom: 1rem; font-size: 1rem">Create New Profile</h3>
|
||||||
<div class="card" style="padding: 1.5rem">
|
<div class="card" style="padding: 1.5rem">
|
||||||
<div class="m-grid">
|
<div class="m-grid" style="grid-template-columns: 1fr 1fr 2fr">
|
||||||
<div>
|
<div>
|
||||||
<label>Profile Name</label>
|
<label>Profile Name</label>
|
||||||
<input type="text" id="new-profile-name" placeholder="e.g. DDR4 RAM, 3060 GPUs">
|
<input type="text" id="new-profile-name" placeholder="e.g. DDR4 RAM, 3060 GPUs">
|
||||||
|
|
@ -259,6 +259,10 @@
|
||||||
<label>Price Ratio (e.g. 0.85)</label>
|
<label>Price Ratio (e.g. 0.85)</label>
|
||||||
<input type="number" id="new-profile-ratio" value="0.85" step="0.01">
|
<input type="number" id="new-profile-ratio" value="0.85" step="0.01">
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>Common Keywords (appended to all queries)</label>
|
||||||
|
<input type="text" id="new-profile-common" placeholder='-laptop "New In Box"'>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn-primary" style="width: 100%" id="btn-save-profile" onclick="saveProfile()">Add Profile</button>
|
<button class="btn-primary" style="width: 100%" id="btn-save-profile" onclick="saveProfile()">Add Profile</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -334,7 +338,8 @@
|
||||||
let currentProfileId = null;
|
let currentProfileId = null;
|
||||||
let items = [];
|
let items = [];
|
||||||
let isScanning = false;
|
let isScanning = false;
|
||||||
const API_URL = "https://logs1.danielvu.com/ebay-price-check"
|
const API_URL = "http://localhost:4000"
|
||||||
|
// const API_URL = "https://logs1.danielvu.com/ebay-price-check"
|
||||||
const fmat = (v) => new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(v || 0);
|
const fmat = (v) => new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(v || 0);
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
|
|
@ -484,6 +489,7 @@
|
||||||
editingProfileId = null;
|
editingProfileId = null;
|
||||||
document.getElementById('new-profile-name').value = '';
|
document.getElementById('new-profile-name').value = '';
|
||||||
document.getElementById('new-profile-ratio').value = '0.85';
|
document.getElementById('new-profile-ratio').value = '0.85';
|
||||||
|
document.getElementById('new-profile-common').value = '';
|
||||||
document.getElementById('btn-save-profile').innerText = 'Add Profile';
|
document.getElementById('btn-save-profile').innerText = 'Add Profile';
|
||||||
document.getElementById('modal-profiles').classList.add('active');
|
document.getElementById('modal-profiles').classList.add('active');
|
||||||
renderProfileList();
|
renderProfileList();
|
||||||
|
|
@ -495,24 +501,29 @@
|
||||||
<div style="display:flex; justify-content:space-between; align-items:center; padding:0.75rem; border-bottom:1px solid var(--border)">
|
<div style="display:flex; justify-content:space-between; align-items:center; padding:0.75rem; border-bottom:1px solid var(--border)">
|
||||||
<div>
|
<div>
|
||||||
<b>${p.name}</b> (Ratio: ${p.price_ratio})<br>
|
<b>${p.name}</b> (Ratio: ${p.price_ratio})<br>
|
||||||
|
${p.common_keywords ? `<small style="color:var(--text-muted)">Common: ${p.common_keywords}</small><br>` : ''}
|
||||||
<small style="color:var(--text-muted)">Last scan: ${lastScan}</small>
|
<small style="color:var(--text-muted)">Last scan: ${lastScan}</small>
|
||||||
</div>
|
</div>
|
||||||
<div style="display:flex; gap:0.5rem">
|
<div style="display:flex; gap:0.5rem">
|
||||||
<button class="btn-outline" style="padding:0.3rem 0.6rem" onclick="editProfile(${p.id}, '${p.name}', ${p.price_ratio})">Edit</button>
|
<button class="btn-outline" style="padding:0.3rem 0.6rem" onclick="editProfile(${p.id})">Edit</button>
|
||||||
<button class="btn-danger" style="padding:0.3rem 0.6rem" onclick="deleteProfile(${p.id})">Delete</button>
|
<button class="btn-danger" style="padding:0.3rem 0.6rem" onclick="deleteProfile(${p.id})">Delete</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;}).join('');
|
`;}).join('');
|
||||||
}
|
}
|
||||||
function editProfile(id, name, ratio) {
|
function editProfile(id) {
|
||||||
|
const p = profiles.find(x => x.id === id);
|
||||||
|
if (!p) return;
|
||||||
editingProfileId = id;
|
editingProfileId = id;
|
||||||
document.getElementById('new-profile-name').value = name;
|
document.getElementById('new-profile-name').value = p.name;
|
||||||
document.getElementById('new-profile-ratio').value = ratio;
|
document.getElementById('new-profile-ratio').value = p.price_ratio;
|
||||||
|
document.getElementById('new-profile-common').value = p.common_keywords || '';
|
||||||
document.getElementById('btn-save-profile').innerText = 'Update Profile';
|
document.getElementById('btn-save-profile').innerText = 'Update Profile';
|
||||||
}
|
}
|
||||||
async function saveProfile() {
|
async function saveProfile() {
|
||||||
const name = document.getElementById('new-profile-name').value;
|
const name = document.getElementById('new-profile-name').value;
|
||||||
const ratio = document.getElementById('new-profile-ratio').value;
|
const ratio = document.getElementById('new-profile-ratio').value;
|
||||||
|
const common = document.getElementById('new-profile-common').value;
|
||||||
if (!name) return;
|
if (!name) return;
|
||||||
|
|
||||||
const method = editingProfileId ? 'PUT' : 'POST';
|
const method = editingProfileId ? 'PUT' : 'POST';
|
||||||
|
|
@ -521,11 +532,16 @@
|
||||||
await fetch(url, {
|
await fetch(url, {
|
||||||
method,
|
method,
|
||||||
headers: {'Content-Type': 'application/json'},
|
headers: {'Content-Type': 'application/json'},
|
||||||
body: JSON.stringify({ name, price_ratio: parseFloat(ratio) })
|
body: JSON.stringify({
|
||||||
|
name,
|
||||||
|
price_ratio: parseFloat(ratio),
|
||||||
|
common_keywords: common
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
editingProfileId = null;
|
editingProfileId = null;
|
||||||
document.getElementById('new-profile-name').value = '';
|
document.getElementById('new-profile-name').value = '';
|
||||||
|
document.getElementById('new-profile-common').value = '';
|
||||||
document.getElementById('btn-save-profile').innerText = 'Add Profile';
|
document.getElementById('btn-save-profile').innerText = 'Add Profile';
|
||||||
await fetchProfiles();
|
await fetchProfiles();
|
||||||
renderProfileList();
|
renderProfileList();
|
||||||
|
|
@ -635,7 +651,7 @@
|
||||||
let keywords = kwPart.split(',').map(s => s.trim()).filter(Boolean);
|
let keywords = kwPart.split(',').map(s => s.trim()).filter(Boolean);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
part_number: (parts[0] === 'NONE' || parts[0] === '' || parts[0] === '""') ? '' : parts[0].replace(/"/g, ''),
|
part_number: (parts[0] === 'NONE' || parts[0] === '' || parts[0] === '""') ? '' : parts[0],
|
||||||
keywords,
|
keywords,
|
||||||
target_price: parseFloat(parts[2].replace(/[$,]/g, ''))
|
target_price: parseFloat(parts[2].replace(/[$,]/g, ''))
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ async function searchEbay(token, keyword, site) {
|
||||||
const cap = CFG.maxItemsPerQuery;
|
const cap = CFG.maxItemsPerQuery;
|
||||||
const exactQuery = keyword.trim().split(/\s+/).map(w => {
|
const exactQuery = keyword.trim().split(/\s+/).map(w => {
|
||||||
if (w.startsWith('-')) return w; // Negative keyword
|
if (w.startsWith('-')) return w; // Negative keyword
|
||||||
return `"${w}"`;
|
return `${w}`;
|
||||||
}).join(' ');
|
}).join(' ');
|
||||||
|
|
||||||
const baseUrl = `https://${BASE_URL}/buy/browse/v1/item_summary/search`
|
const baseUrl = `https://${BASE_URL}/buy/browse/v1/item_summary/search`
|
||||||
|
|
@ -376,8 +376,9 @@ async function processRow(token, row, rowIndex, totalRows, globalResultsMap, pro
|
||||||
|
|
||||||
for (const site of EBAY_SITES) {
|
for (const site of EBAY_SITES) {
|
||||||
for (const { label, query } of queries) {
|
for (const { label, query } of queries) {
|
||||||
log(` [${rowIndex + 1}] [${site.id}] [${label}] Searching: "${query}"`);
|
const searchQuery = profile.common_keywords ? `${query} ${profile.common_keywords}` : query;
|
||||||
const items = await searchEbay(token, query, site);
|
log(` [${rowIndex + 1}] [${site.id}] [${label}] Searching: "${searchQuery}"`);
|
||||||
|
const items = await searchEbay(token, searchQuery, site);
|
||||||
|
|
||||||
let skipped = 0, cnSkipped = 0, dbSkipped = 0;
|
let skipped = 0, cnSkipped = 0, dbSkipped = 0;
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
|
|
|
||||||
10
server.js
10
server.js
|
|
@ -35,7 +35,7 @@ app.get('/api/profiles', (req, res) => {
|
||||||
let profiles = db.getProfiles();
|
let profiles = db.getProfiles();
|
||||||
if (profiles.length === 0) {
|
if (profiles.length === 0) {
|
||||||
// Create a default profile if none exists
|
// Create a default profile if none exists
|
||||||
db.addProfile('Default Profile', 0.85);
|
db.addProfile('Default Profile', 0.85, null);
|
||||||
profiles = db.getProfiles();
|
profiles = db.getProfiles();
|
||||||
}
|
}
|
||||||
res.json(profiles);
|
res.json(profiles);
|
||||||
|
|
@ -46,8 +46,8 @@ app.get('/api/profiles', (req, res) => {
|
||||||
|
|
||||||
app.post('/api/profiles', (req, res) => {
|
app.post('/api/profiles', (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { name, price_ratio } = req.body;
|
const { name, price_ratio, common_keywords } = req.body;
|
||||||
db.addProfile(name, price_ratio || 0.85);
|
db.addProfile(name, price_ratio || 0.85, common_keywords);
|
||||||
res.json({ success: true });
|
res.json({ success: true });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
res.status(500).json({ error: err.message });
|
res.status(500).json({ error: err.message });
|
||||||
|
|
@ -56,8 +56,8 @@ app.post('/api/profiles', (req, res) => {
|
||||||
|
|
||||||
app.put('/api/profiles/:id', (req, res) => {
|
app.put('/api/profiles/:id', (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { name, price_ratio } = req.body;
|
const { name, price_ratio, common_keywords } = req.body;
|
||||||
db.updateProfile(req.params.id, name, price_ratio);
|
db.updateProfile(req.params.id, name, price_ratio, common_keywords);
|
||||||
res.json({ success: true });
|
res.json({ success: true });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
res.status(500).json({ error: err.message });
|
res.status(500).json({ error: err.message });
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
"SSDSC2BX200" | "200GB" -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 14.00
|
||||||
|
"SSDSC2BA200" | "200GB" -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 14.00
|
||||||
|
"SSDSC2KB200G8" | "200GB" -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 14.00
|
||||||
|
"MZ7KE256" | "256GB" -200GB -240GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 17.92
|
||||||
|
"MZ76P256" | "256GB" -200GB -240GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 17.92
|
||||||
|
"MZ7LN256" | "256GB" -200GB -240GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 17.92
|
||||||
|
"CT256MX" | "256GB" -200GB -240GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 17.92
|
||||||
|
"MZ77E500" | "512GB" -200GB -240GB -256GB -320GB -480GB -500GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 35.84
|
||||||
|
"MZ76E500" | "512GB" -200GB -240GB -256GB -320GB -480GB -500GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 35.84
|
||||||
|
"SSDSC2KB512G8" | "512GB" -200GB -240GB -256GB -320GB -480GB -500GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 35.84
|
||||||
|
"CT500MX500" | "512GB" -200GB -240GB -256GB -320GB -480GB -500GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 35.84
|
||||||
|
"SSDSC2BX800" | "800GB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 56.00
|
||||||
|
"SSDSC2BA800" | "800GB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 56.00
|
||||||
|
"MZ7LM800" | "800GB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 56.00
|
||||||
|
"816576-001" | "800GB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 56.00
|
||||||
|
"MZ7KH960" | "960GB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 67.20
|
||||||
|
"MZ7LM960" | "960GB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 67.20
|
||||||
|
"MTFDDAK960" | "960GB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 67.20
|
||||||
|
"SSDSC2KB960G8" | "960GB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 67.20
|
||||||
|
"MZ77E1T0" | "1TB" -200GB -240GB -250GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 70.00
|
||||||
|
"WDS100T2B0A" | "1TB" -200GB -240GB -250GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 70.00
|
||||||
|
"CT1000MX500" | "1TB" -200GB -240GB -250GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 70.00
|
||||||
|
"SSDSC2KB010T8" | "1TB" -200GB -240GB -250GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 70.00
|
||||||
|
"MZ77E2T0" | "2TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 140.00
|
||||||
|
"CT2000MX500" | "2TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 140.00
|
||||||
|
"WDS200T2B0A" | "2TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 140.00
|
||||||
|
"MTFDDAK1T9" | "2TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 140.00
|
||||||
|
"MZ77E4T0" | "4TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 280.00
|
||||||
|
"WDS400T3B0A" | "4TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 280.00
|
||||||
|
"P21514-001" | "4TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 280.00
|
||||||
|
"SSDSC2KB038T7" | "4TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 280.00
|
||||||
|
"MZ77Q8T0" | "8TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 560.00
|
||||||
|
"MTFDDAK7T6TDC" | "8TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 560.00
|
||||||
|
"WDS800T2B0A" | "8TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 560.00
|
||||||
|
"MZ7KH1T9" | "1.92TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 134.40
|
||||||
|
"SSDSC2KB019T8" | "1.92TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 134.40
|
||||||
|
"816562-001" | "1.92TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 134.40
|
||||||
|
"0MWGK7" | "1.92TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB -15.36TB | 134.40
|
||||||
|
"MZ7KH3T8" | "3.84TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -6.4TB -7.68TB -15.36TB | 268.80
|
||||||
|
"SSDSC2KB038T8" | "3.84TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -6.4TB -7.68TB -15.36TB | 268.80
|
||||||
|
"MTFDDAK3T8TDT" | "3.84TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -6.4TB -7.68TB -15.36TB | 268.80
|
||||||
|
"P19976-B21" | "3.84TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -6.4TB -7.68TB -15.36TB | 268.80
|
||||||
|
"MZ7KH7T6" | "7.68TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -15.36TB | 537.60
|
||||||
|
"SSDSC2KB076T8" | "7.68TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -15.36TB | 537.60
|
||||||
|
"MTFDDAK7T6TDT" | "7.68TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -15.36TB | 537.60
|
||||||
|
"P19980-B21" | "7.68TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -15.36TB | 537.60
|
||||||
|
"MZILS15T" | "15.36TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB | 1075.20
|
||||||
|
"MZILG15T" | "15.36TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB | 1075.20
|
||||||
|
"WUS4BB015D7P3E3" | "15.36TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB | 1075.20
|
||||||
|
"SSDSC2KB153T8" | "15.36TB" -200GB -240GB -256GB -320GB -480GB -500GB -512GB -800GB -960GB -1TB -2TB -3TB -4TB -5TB -6TB -8TB -10TB -12TB -16TB -1.6TB -1.8TB -1.92TB -3.2TB -3.8TB -3.84TB -6.4TB -7.68TB | 1075.20
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
const Database = require('better-sqlite3');
|
||||||
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const dbPath = path.join(__dirname, 'data', 'ebay_items.db');
|
||||||
|
|
||||||
|
if (!fs.existsSync(dbPath)) {
|
||||||
|
console.error(`Database not found at: ${dbPath}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const db = new Database(dbPath);
|
||||||
|
|
||||||
|
try {
|
||||||
|
console.log('Truncating items table...');
|
||||||
|
const result = db.prepare('DELETE FROM items').run();
|
||||||
|
console.log(`Success! Deleted ${result.changes} items.`);
|
||||||
|
|
||||||
|
// Optional: vacuum the database to reclaim space
|
||||||
|
console.log('Vacuuming database...');
|
||||||
|
db.exec('VACUUM');
|
||||||
|
console.log('Vacuum complete.');
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error truncating items table:', err.message);
|
||||||
|
} finally {
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue