mirror of
https://github.com/badlogic/heissepreise.git
synced 2024-06-24 09:25:53 +02:00
Fix replay(), fix thead see #27
This commit is contained in:
parent
bf47a1d268
commit
55af83b3d0
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ data/
|
|||
dist
|
||||
heissepreise.zip
|
||||
site/latest-canonical.json
|
||||
latest-canonical.json
|
||||
|
|
|
@ -102,7 +102,7 @@ exports.replay = function(rawDataDir) {
|
|||
return dateA - dateB;
|
||||
};
|
||||
|
||||
const getFilteredFilesFor = (store) => files.filter(file => file.indexOf(`${store}-` == 0).sort(dateSort).map(file => rawDataDir + "/" + file));
|
||||
const getFilteredFilesFor = (store) => files.filter(file => file.indexOf(`${store}-`) == 0).sort(dateSort).map(file => rawDataDir + "/" + file);
|
||||
|
||||
const storeFiles = {};
|
||||
const canonicalFiles = {};
|
||||
|
|
|
@ -9,7 +9,7 @@ async function load() {
|
|||
},
|
||||
null,
|
||||
(header) => {
|
||||
header = dom("thead", `<tr><th>Kette</th><th>Name</th><th>Menge</th><th>Preis 📈</th><th></th></tr>`)
|
||||
header = dom("tr", `<th>Kette</th><th>Name</th><th>Menge</th><th>Preis 📈</th><th></th>`)
|
||||
const showHideAll = header.querySelectorAll('th:nth-child(4)')[0];
|
||||
showHideAll.style["cursor"] = "pointer";
|
||||
showHideAll.showAll = true;
|
||||
|
|
15
stuff.js
15
stuff.js
|
@ -137,4 +137,17 @@ function momentumCartConversion() {
|
|||
fs.writeFileSync("site/momentum-cart.json", JSON.stringify(cart, null, 2));
|
||||
}
|
||||
|
||||
momentumCartConversion();
|
||||
function fixSparHistoricalData(dataDir) {
|
||||
const files = fs.readdirSync(dataDir).filter(file => file.indexOf("canonical") == -1 && file.indexOf(`spar-`) == 0);
|
||||
console.log(files);
|
||||
|
||||
for (file of files) {
|
||||
const items = JSON.parse(fs.readFileSync(`${dataDir}/${file}`));
|
||||
if (items.hits) {
|
||||
console.log(`Rewriting ${file}`);
|
||||
fs.writeFileSync(`${dataDir}/${file}`, JSON.stringify(items.hits, null, 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// momentumCartConversion();
|
Loading…
Reference in New Issue
Block a user