Files

82 lines
2.8 KiB
Markdown

---
name: community-trend
description: 커뮤니티 사이트(DCInside 등) 갤러리의 최신 인기글을 조회하고 트렌드를 분석하는 도구
---
# 커뮤니티 트렌드 도구
DCInside 갤러리(마이너/일반)의 인기글을 스크래핑하여 랭킹을 보여주거나 글 본문을 조회합니다.
## 사용 시나리오
사용자가 "커피갤 트렌드", "일렉기타갤 인기글", "XX갤 최신글 요약" 등을 요청하면 이 도구를 사용합니다.
## 도구 위치
```
tools/community_scraper.py
```
## 실행 방법
반드시 아래 Python 경로를 사용하세요:
```bash
C:\ProgramData\miniforge3\envs\variet-agent\python.exe tools/community_scraper.py <command> [args]
```
### 1. 인기글 랭킹 (trend)
```bash
# 기본: 최근 6시간, 상위 10개, 종합점수 기준
C:\ProgramData\miniforge3\envs\variet-agent\python.exe tools/community_scraper.py trend coffee
# 조회수 기준 상위 5개
C:\ProgramData\miniforge3\envs\variet-agent\python.exe tools/community_scraper.py trend coffee --sort views --top 5
# 추천수 기준, 3시간 이내
C:\ProgramData\miniforge3\envs\variet-agent\python.exe tools/community_scraper.py trend coffee --sort recommends --hours 3
# 댓글수 기준
C:\ProgramData\miniforge3\envs\variet-agent\python.exe tools/community_scraper.py trend coffee --sort comments --top 10
# 일반 갤러리 (마이너가 아닌 경우)
C:\ProgramData\miniforge3\envs\variet-agent\python.exe tools/community_scraper.py trend programming --type gallery
# JSON 출력
C:\ProgramData\miniforge3\envs\variet-agent\python.exe tools/community_scraper.py trend coffee --format json
```
**옵션:**
- `--hours N`: 최근 N시간 이내 필터 (기본: 6)
- `--top N`: 상위 N개 (기본: 10)
- `--sort`: score(종합), views(조회수), recommends(추천), comments(댓글)
- `--type`: mgallery(마이너), mini(미니), gallery(일반)
- `--pages N`: 스크래핑할 페이지 수 (기본: 5)
- `--format`: markdown 또는 json
### 2. 글 본문 조회 (view)
```bash
# 특정 글 본문 읽기
C:\ProgramData\miniforge3\envs\variet-agent\python.exe tools/community_scraper.py view coffee 544618
# JSON 출력
C:\ProgramData\miniforge3\envs\variet-agent\python.exe tools/community_scraper.py view coffee 544618 --format json
```
## 알려진 갤러리 ID (예시)
| 갤러리 | ID | 유형 |
|--------|-----|------|
| 커피 | coffee | mgallery |
| 일렉기타 | electricguitar | mgallery |
| 프로그래밍 | programming | gallery |
## 트렌드 응답 시 지침
1. `trend` 실행 결과를 받으면, 상위 글들의 제목과 수치를 요약해서 보여주세요.
2. "어떤 주제가 화제인지", "어떤 트렌드가 보이는지" 간략히 분석해주세요.
3. 사용자가 특정 글을 더 보고 싶어하면 `view`로 본문을 조회해주세요.
4. 출력은 항상 한국어로 해주세요.