feat: prototype gap closure — enrichment diagnosis + brand extraction + plan assets
Phase 1: Data Pipeline Fixes - Plan page: connect enrichment data for Asset Collection + YouTube Repurpose - mergeEnrichment: generate 15-20 data-driven diagnosis items from enrichment (YouTube Shorts check, IG engagement, FB activity, 강남언니 ratings, GMaps) - ClinicSnapshot: fill staffCount, nearestStation, certifications from enrichment Phase 2: AI + Brand Enhancement - AI prompt: per-channel diagnosis[] array (5-7 items), established, nameEn, newChannelProposals - scrape-website: Firecrawl branding extraction (colors, fonts, logo, tagline) - transformPlan: BrandGuide colors/fonts from scraped branding data - transformPlan: cross-channel brand consistency analysis (name, phone mismatches) - transformPlan: channel branding rules from enrichment (YT, IG, FB profiles) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a7d8aeeddc
commit
e32b8766de
4 files changed
+380
-31
No files matched your search
@@ -122,9 +122,48 @@ Deno.serve(async (req) => {
|
||||
|
||||
const searchData = await searchResponse.json();
|
||||
|
||||
// Step 4: Extract branding (colors, fonts, logos) from the website
|
||||
let brandingData: Record<string, unknown> = {};
|
||||
try {
|
||||
const brandResponse = await fetch("https://api.firecrawl.dev/v1/scrape", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${FIRECRAWL_API_KEY}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
url,
|
||||
formats: ["json"],
|
||||
jsonOptions: {
|
||||
prompt: "Extract brand identity from this website: primary brand colors (hex codes), accent colors, background colors, font families used (headings and body), logo image URLs (header logo, favicon), and main tagline/slogan",
|
||||
schema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
primaryColor: { type: "string" },
|
||||
accentColor: { type: "string" },
|
||||
backgroundColor: { type: "string" },
|
||||
textColor: { type: "string" },
|
||||
headingFont: { type: "string" },
|
||||
bodyFont: { type: "string" },
|
||||
logoUrl: { type: "string" },
|
||||
faviconUrl: { type: "string" },
|
||||
tagline: { type: "string" },
|
||||
},
|
||||
},
|
||||
},
|
||||
waitFor: 3000,
|
||||
}),
|
||||
});
|
||||
const brandResult = await brandResponse.json();
|
||||
brandingData = brandResult.data?.json || {};
|
||||
} catch {
|
||||
// Branding extraction is optional — don't fail the whole scrape
|
||||
}
|
||||
|
||||
// Combine all data
|
||||
const result = {
|
||||
clinic: scrapeData.data?.json || {},
|
||||
branding: brandingData,
|
||||
siteLinks: scrapeData.data?.links || [],
|
||||
siteMap: mapData.success ? mapData.links || [] : [],
|
||||
reviews: searchData.data || [],
|
||||
|
||||
Reference in new issue
Block a user