[object Object]

← back to Screenprintedwallpaper

pull-from-shopify: use shared classifier with rails primary, local aestheticOf as fallback

55692efb6ec81ff8b55b28e02f1626cd71aa55d3 · 2026-05-25 20:46:12 -0700 · Steve Abrams

Files touched

Diff

commit 55692efb6ec81ff8b55b28e02f1626cd71aa55d3
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 bdec43d..d028857 100644
--- a/scripts/pull-from-shopify.js
+++ b/scripts/pull-from-shopify.js
@@ -4,6 +4,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_TAG = /\b(screen[\s-]?print|silk[\s-]?screen|screenprinted)\b/i;
 const NICHE_TITLE = /\b(screen[\s-]?print|screen[\s-]?printed|silk[\s-]?screen)\b/i;
@@ -27,6 +29,12 @@ function aestheticOf(tags, title) {
   return 'screen-print';
 }
 
+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++) {
@@ -54,7 +62,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}`,
     }));
 

← 7c179d1 retag aesthetic from PG: 80 rows updated  ·  back to Screenprintedwallpaper  ·  wire api-vendor-redact middleware + /api/facets respects cur bc239fa →