feat: 강남언니 real-time data collection via Firecrawl scraping
- enrich-channels: add 강남언니 scraping module (search + structured JSON extraction) - Collects: rating/10, reviews, doctors with ratings, procedures, certifications - transformReport: merge 강남언니 data into clinicSnapshot + otherChannels - Updates lead doctor info, certifications, and review counts from real data Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e5399486f7
commit
cf482d1bd7
2 files changed
+142
-1
No files matched your search
@@ -399,6 +399,17 @@ export interface EnrichmentData {
|
||||
thumbnail?: string;
|
||||
}[];
|
||||
};
|
||||
gangnamUnni?: {
|
||||
name?: string;
|
||||
rating?: number;
|
||||
ratingScale?: string;
|
||||
totalReviews?: number;
|
||||
doctors?: { name?: string; rating?: number; reviews?: number; specialty?: string }[];
|
||||
procedures?: string[];
|
||||
address?: string;
|
||||
badges?: string[];
|
||||
sourceUrl?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -533,5 +544,50 @@ export function mergeEnrichment(
|
||||
}
|
||||
}
|
||||
|
||||
// 강남언니 enrichment
|
||||
if (enrichment.gangnamUnni) {
|
||||
const gu = enrichment.gangnamUnni;
|
||||
|
||||
// Update clinic snapshot with real gangnamUnni data
|
||||
if (gu.rating) {
|
||||
merged.clinicSnapshot = {
|
||||
...merged.clinicSnapshot,
|
||||
overallRating: gu.rating,
|
||||
totalReviews: gu.totalReviews ?? merged.clinicSnapshot.totalReviews,
|
||||
certifications: gu.badges?.length ? gu.badges : merged.clinicSnapshot.certifications,
|
||||
};
|
||||
}
|
||||
|
||||
// Update lead doctor with gangnamUnni doctor data
|
||||
if (gu.doctors?.length) {
|
||||
const topDoctor = gu.doctors[0];
|
||||
if (topDoctor?.name) {
|
||||
merged.clinicSnapshot = {
|
||||
...merged.clinicSnapshot,
|
||||
leadDoctor: {
|
||||
name: topDoctor.name,
|
||||
credentials: topDoctor.specialty || merged.clinicSnapshot.leadDoctor.credentials,
|
||||
rating: topDoctor.rating ?? 0,
|
||||
reviewCount: topDoctor.reviews ?? 0,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Update gangnamUnni channel in otherChannels
|
||||
const guChannelIdx = merged.otherChannels.findIndex(c => c.name === '강남언니');
|
||||
const guChannel = {
|
||||
name: '강남언니',
|
||||
status: 'active' as const,
|
||||
details: `평점: ${gu.rating ?? '-'}${gu.ratingScale || '/10'} / 리뷰: ${gu.totalReviews?.toLocaleString() ?? '-'}건`,
|
||||
url: gu.sourceUrl || '',
|
||||
};
|
||||
if (guChannelIdx >= 0) {
|
||||
merged.otherChannels[guChannelIdx] = guChannel;
|
||||
} else {
|
||||
merged.otherChannels = [...merged.otherChannels, guChannel];
|
||||
}
|
||||
}
|
||||
|
||||
return merged;
|
||||
}
|
||||
Reference in new issue
Block a user