← back to Handcraftedwallpaper
pull-from-shopify: use shared classifier with rails primary, local aestheticOf as fallback
fab0ab668c9e335d2c6de386314d88627b1d77f1 · 2026-05-25 20:46:12 -0700 · Steve Abrams
Files touched
M scripts/pull-from-shopify.js
Diff
commit fab0ab668c9e335d2c6de386314d88627b1d77f1
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon May 25 20:46:12 2026 -0700
pull-from-shopify: use shared classifier with rails primary, local aestheticOf as fallback
---
scripts/pull-from-shopify.js | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/scripts/pull-from-shopify.js b/scripts/pull-from-shopify.js
index 9946497..070bec7 100644
--- a/scripts/pull-from-shopify.js
+++ b/scripts/pull-from-shopify.js
@@ -3,6 +3,8 @@
const https = require('https');
const fs = require('fs');
const path = require('path');
+const { classifyAesthetic } = require('../../_shared/microsite-aesthetic');
+const SITE_CFG_RAILS = (() => { try { return require('../site.config.json').rails || []; } catch { return []; } })();
const NICHE = /\b(handcraft|hand[\s-]?made|hand[\s-]?painted|hand[\s-]?paint|artisan|hand[\s-]?stitch|hand[\s-]?embroidered|hand[\s-]?block)\b/i;
const REJECT_TITLE = /(visual.{0,3}merchandiser|bh.?90210|\bimage[ _-]?4\b|lamp|rug|pillow|throw|tripod|frame|mirror|vase|candle|sculpture|figurine)/i;
@@ -28,6 +30,12 @@ function aestheticOf(tags, title) {
return 'handmade';
}
+function classifyForSite(tags, title) {
+ const railsMatch = classifyAesthetic(tags, SITE_CFG_RAILS);
+ if (railsMatch && railsMatch !== 'all') return railsMatch;
+ return aestheticOf(tags, title);
+}
+
(async () => {
const all = [];
for (let page = 1; page <= 30; page++) {
@@ -51,7 +59,7 @@ function aestheticOf(tags, title) {
product_type: p.product_type,
image_url: p.images[0].src,
tags: p.tags || [],
- aesthetic: aestheticOf(p.tags, p.title),
+ aesthetic: classifyForSite(p.tags, p.title),
product_url: `https://designerwallcoverings.com/products/${p.handle}`,
}));
← 69cece3 retag aesthetic from PG: 15 rows updated
·
back to Handcraftedwallpaper
·
wire api-vendor-redact middleware — mount first so all /api/ 5aa683a →