mirror of
https://github.com/samsonjs/spirit-tracker.git
synced 2026-03-25 09:25:51 +00:00
feat: New BSW Store
This commit is contained in:
parent
4a7d1385b5
commit
023128812d
3 changed files with 11 additions and 4 deletions
|
|
@ -380,6 +380,12 @@ function createStore(defaultUa) {
|
|||
startUrl: "https://www.bswliquor.com/collections/rum?page=1",
|
||||
bswRuleContext: "rum",
|
||||
},
|
||||
{
|
||||
key: "whisky",
|
||||
label: "Whisky",
|
||||
startUrl: "https://www.bswliquor.com/collections/whisky?page=1",
|
||||
bswRuleContext: "whisky",
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ function renderHtml({ title, subtitle, uniqueNews, bigSales, commitUrl, pagesUrl
|
|||
<td style="padding:12px;vertical-align:top">
|
||||
<div style="font-weight:700;font-size:14px;line-height:1.3">${name}</div>
|
||||
<div style="color:#666;font-size:12px;margin-top:2px">${store}${cat ? " · " + cat : ""}</div>
|
||||
<div style="margin-top:8px;font-size:13px"><span style="font-weight:700">${price}</span></div>
|
||||
${price ? `<div style="margin-top:8px;font-size:13px"><span style="font-weight:700">${price}</span></div>` : ""}
|
||||
${extraHtml || ""}
|
||||
${url ? `<div style="margin-top:8px"><a href="${url}" style="color:#0b57d0;text-decoration:none">View item</a></div>` : ""}
|
||||
</td>
|
||||
|
|
@ -331,7 +331,7 @@ function renderHtml({ title, subtitle, uniqueNews, bigSales, commitUrl, pagesUrl
|
|||
${pct !== null ? `<span style="margin-left:8px;color:#137333;font-weight:700">(${pct}% off)</span>` : ""}
|
||||
</div>
|
||||
`;
|
||||
return card({ ...it, price: it.newPrice }, extra);
|
||||
return card({ ...it, price: "" }, extra);
|
||||
})
|
||||
.join("");
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,13 @@ for (const file of fs.readdirSync(DB_DIR)) {
|
|||
const data = JSON.parse(fs.readFileSync(path.join(DB_DIR, file), "utf8"));
|
||||
if (!Array.isArray(data.items)) continue;
|
||||
|
||||
for (const { sku, url } of data.items) {
|
||||
for (const { sku, url, removed } of data.items) {
|
||||
if (
|
||||
removed === false &&
|
||||
typeof sku === "string" &&
|
||||
sku.startsWith("u:") &&
|
||||
url &&
|
||||
(includeLinked || !linkedSkus.has(String(sku)))
|
||||
(includeLinked || !linkedSkus.has(sku))
|
||||
) {
|
||||
console.log(url);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue