Skip to content

Instantly share code, notes, and snippets.

@claudianus
Created April 7, 2026 07:17
Show Gist options
  • Select an option

  • Save claudianus/9c6e177543c5280a65ed75bd421a2c55 to your computer and use it in GitHub Desktop.

Select an option

Save claudianus/9c6e177543c5280a65ed75bd421a2c55 to your computer and use it in GitHub Desktop.
블라인드(teamblind.com) AI 자동생성 크롤러 파싱 스크립트 (Gemini Flash)
/**
* 블라인드(teamblind.com) 상세 페이지 파서
* target_kind: "comments"
*
* 실행 컨텍스트: new AsyncFunction('$', 'fetch', 'url', 'externalId', scriptBody)
* - $ : cheerio 인스턴스 (HTML 로드 완료)
* - fetch : 샌드박스용 fetch 함수
* - url : 상세 페이지 URL
* - externalId : 게시글 고유 ID
*
* AI Agent 자동 생성 (2026-04-06 12:16 UTC)
* DB 테이블: crawler_logic_script (source_key='blind', target_kind='comments')
*/
const results = [];
const postTitle = $('.article-view-head h2').text().trim();
const postContent = $('#contentArea').text().trim();
const author = $('.article-view-head .name a.point').text().trim();
const date = $('.article-view-head .wrap-info .date').text().trim();
const viewCount = parseInt($('.article-view-head .wrap-info .pv').text().replace(/[^0-9]/g, '') || '0');
const likeCount = parseInt($('.article_info .info .like').text().replace(/[^0-9]/g, '') || '0');
const commentCount = parseInt($('.article_info .info .cmt').text().replace(/[^0-9]/g, '') || '0');
results.push({
externalId: url.split('/').pop(),
title: postTitle,
link: url,
summary: postContent,
date: date,
viewCount: viewCount,
likeCount: likeCount,
commentCount: commentCount,
author: author
});
return results;
/**
* 블라인드(teamblind.com) 게시글 목록 파서
* target_kind: "list"
*
* 실행 컨텍스트: new AsyncFunction('$', 'fetch', 'url', scriptBody)
* - $ : cheerio 인스턴스 (HTML 로드 완료)
* - fetch : 샌드박스용 fetch 함수
* - url : 수집 대상 URL
*
* AI Agent 자동 생성 (2026-04-06 15:15 UTC)
* DB 테이블: crawler_logic_script (source_key='blind', target_kind='list')
*/
const items = [];
const elements = $('.article-list > div.article-list-pre');
elements.each((i, el) => {
const $el = $(el);
if ($el.hasClass('article-list-ad') || $el.hasClass('coupang-ad')) return;
// Find title link
const titleLink = $el.find('.tit h3 a');
const href = titleLink.attr('href');
if (!href) return;
// Construct full link
const fullLink = new URL(href, 'https://www.teamblind.com').href;
const title = titleLink.text().trim();
const summary = $el.find('.pre-txt a').text().trim();
// Split author/company text
const authorText = $el.find('.sub .name a').text().trim();
const parts = authorText.split('·');
const author = parts.length > 1 ? parts[1].trim() : (parts[0].trim() || 'Unknown');
const viewCount = parseInt($el.find('.pv').text().replace(/[^0-9]/g, '') || 0);
const likeCount = parseInt($el.find('.like').text().replace(/[^0-9]/g, '') || 0);
const commentCount = parseInt($el.find('.cmt').text().replace(/[^0-9]/g, '') || 0);
// Fix externalID extraction
const externalId = href.split('/').pop() || '';
items.push({
externalId,
title,
link: fullLink,
summary,
author,
viewCount,
likeCount,
commentCount
});
});
return items;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment