Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ea9f8f04b | ||
|
|
2b1fa58f56 | ||
|
|
5bcf962e93 | ||
|
|
0578c127d5 | ||
|
|
d7dfc1ba82 | ||
|
|
4e69c4ac44 | ||
|
|
7478a6fa58 | ||
|
|
28a6b79b00 | ||
|
|
63a786e8e3 | ||
|
|
dd6ab20aa8 | ||
|
|
9b01ca554c | ||
|
|
22cfa2fc6a | ||
|
|
c4eeae9252 | ||
|
|
95ac3de7fe | ||
|
|
9e3e750b6c | ||
|
|
c59c2b0f56 | ||
|
|
d880307d85 | ||
|
|
b03a3d501d | ||
|
|
2b6657c951 | ||
|
|
ceb700f0a8 | ||
|
|
8457333a92 | ||
|
|
de39195a61 | ||
|
|
38ae9374fd | ||
|
|
6383911fb3 | ||
|
|
fc0ac46b57 | ||
|
|
99033d13db | ||
|
|
3e3432ea4f | ||
|
|
7fcd9380ae | ||
|
|
6abeabf5a0 | ||
|
|
f14f178f8b | ||
|
|
9ff44143b5 | ||
|
|
1dd74bda05 | ||
|
|
02cd64a18c | ||
|
|
c02f91c6d8 | ||
|
|
da71ad5bad | ||
|
|
939edeedb6 | ||
|
|
e64b001bf9 | ||
|
|
a228fcf560 | ||
|
|
2a94ebe85b | ||
|
|
a80f039444 | ||
|
|
c8287b4bf3 | ||
|
|
e0e9f169d7 | ||
|
|
864cdf2448 | ||
|
|
eaa62751cd | ||
|
|
4a2da04f98 | ||
|
|
f5bf98fb34 | ||
|
|
775c28e6ca | ||
|
|
189d51f1ce | ||
|
|
9a7e0ddc75 | ||
|
|
e5cdfa2642 | ||
|
|
6daa2f4d2a | ||
|
|
02ebcda0ea | ||
|
|
47526c1cef | ||
|
|
697c4bfb20 | ||
|
|
5a88b08a44 | ||
|
|
f6884fe9c9 | ||
|
|
c15f045c64 | ||
|
|
e40a9a0539 | ||
|
|
01b5f917b9 | ||
|
|
e8b8cc79b6 | ||
|
|
709dcf742e | ||
|
|
cab3336859 | ||
|
|
fcc7ed804c | ||
|
|
a8efb36041 | ||
|
|
afa83d8b79 | ||
|
|
d7fffc80a4 | ||
|
|
ce1d222216 | ||
|
|
ed2ab86404 | ||
|
|
ec9e3a52c4 | ||
|
|
7a73c33c73 | ||
|
|
5dc61770f4 | ||
|
|
82ca286ea4 | ||
|
|
442441931f | ||
|
|
1f040bc6d4 | ||
|
|
df34d0a1b4 | ||
|
|
b436ee0e0a | ||
|
|
9f6a6b477b | ||
|
|
cfd45c3b3a | ||
|
|
70286030b1 | ||
|
|
89ad5e1600 | ||
|
|
1c9e15500b | ||
|
|
cff44be771 | ||
|
|
26624f0888 | ||
|
|
4a110c70de | ||
|
|
19d84397ce | ||
|
|
9431dc31c2 | ||
|
|
08f9275c45 | ||
|
|
66f0bf8072 | ||
|
|
4fec164364 | ||
|
|
3c58552852 | ||
|
|
4b321c1991 | ||
|
|
48299e3ac5 | ||
|
|
4f36451da0 | ||
|
|
751beb6e33 | ||
|
|
e0c3cbf6ea | ||
|
|
c5b0806cbc | ||
|
|
dba3d78f14 | ||
|
|
d082e71316 | ||
|
|
b8b5bcf31a | ||
|
|
fabf9b3910 | ||
|
|
49df651cfe | ||
|
|
f6cb6f2deb | ||
|
|
9f6bb16285 | ||
|
|
fb12a7dfb4 | ||
|
|
8f5df2d352 | ||
|
|
263f01b4f1 | ||
|
|
b9dd0f203d | ||
|
|
549e227f90 | ||
|
|
b8afbe4e0a | ||
|
|
d7f891fddb | ||
|
|
63db0b725b | ||
|
|
9fdd299251 | ||
|
|
f7a2a98e94 | ||
|
|
870e1f62aa | ||
|
|
4143ae36dd | ||
|
|
032d8fa3d7 | ||
|
|
cdde9ea7b6 | ||
|
|
2483dbf9ba | ||
|
|
08a2e9f907 | ||
|
|
f35149d282 | ||
|
|
0c785f9774 | ||
|
|
83c40df645 | ||
|
|
2986689415 | ||
|
|
0f22d1fa81 | ||
|
|
db65ac2349 | ||
|
|
73e747436a | ||
|
|
051452d3b1 | ||
|
|
cf7c96eaff | ||
|
|
890b94818d | ||
|
|
304dc3ce4b | ||
|
|
9424947775 | ||
|
|
2f4a0c3bad | ||
|
|
7aad7f929c | ||
|
|
cd96359f6f | ||
|
|
8be84bff00 | ||
|
|
6583c1b28c | ||
|
|
e28359ff47 | ||
|
|
df3fba720c | ||
|
|
becd26d1da | ||
|
|
239a22ee06 | ||
|
|
cc5ecd7bbf | ||
|
|
597017bd37 | ||
|
|
89221535ba | ||
|
|
8ccdf22882 | ||
|
|
e962304107 | ||
|
|
8191881f6a | ||
|
|
7ffeecbb4f | ||
|
|
4875ea4333 | ||
|
|
77cfb04808 | ||
|
|
9dc7a52383 | ||
|
|
130f14e96a | ||
|
|
b240ecb180 | ||
|
|
21bfa2a3ff | ||
|
|
61023d090e | ||
|
|
2fd6fcbd06 | ||
|
|
acb6c4d717 | ||
|
|
81b17f057f | ||
|
|
51e0c06f2d | ||
|
|
0a84f34729 | ||
|
|
2627dd2685 |
No files matched your search
@@ -9,7 +9,7 @@ argument-hint: "<타로 주제> <코디 스타일> 예) 건강 운동 minimal"
|
||||
1. 관리자 서버: `curl -s http://localhost:5175/api/targets` 에 `king` 이 있어야 한다. 없으면 `admin/` 에서 백그라운드로 켠다 (`admin/AGENTS.md` '켜기', 킹서버 키는 `ssh King_admin` 의 `~/proj/o2o-weather/.env` `ADMIN_API_KEY`, 값은 출력하지 않는다).
|
||||
2. 예보: `curl -s "https://weather.o2o.kr/v1/weather/today?region=1114000000"` 의 `day` 가 오늘인지 보고 slots 의 기온·하늘·비 확률을 적어 둔다.
|
||||
3. 타로: `cd admin && VITE_API_BASE_URL=https://weather.o2o.kr ADMIN_URL=http://localhost:5175 npm run card -- tarot --topic "<주제>" --color sky --post-wait`.
|
||||
출력된 기획 문구를 2의 예보와 대조한다(숫자·하늘 묘사가 틀리면 `--copy <값> --feedback "실제 수치…"` 로 한 번만 다시). "일부 그림을 못 만들어" 가 나오면 멈추고 보고한다. 크롬이 한 장에서 45초 넘게 멈추면 그 프로세스를 죽이고 그 장만 다시 찍는다.
|
||||
출력된 기획 문구를 2의 예보와 대조한다(숫자·하늘 묘사가 틀리면 `--copy <값> --feedback "실제 수치…"` 로 한 번만 다시). "일부 그림을 못 만들어" 가 나오면 멈추고 보고한다. 크롬이 한 장에서 45초 넘게 멈추면 `card.mjs` 가 그 장만 한 번 다시 찍는다(또 멈추면 멈추고 보고한다).
|
||||
4. 코디(그날 코디): `npm run card -- ootd --daily --style <스타일> --color sky --post-wait`. 무신사 인기 스냅 중 그 스타일 태그(꾸안꾸·오피스룩·캐주얼·스트릿·정장)가 붙은 것에서 사람 4명(20-30대·40대~ 여·남) 코디를 고르고, Claude 가 옷 목록을 뽑고, Codex 가 참고 사진대로 플랫레이 그림을 그린다(사람당 2~4분). 고른 스냅 주소와 옷 목록이 출력된다. "스냅이 없어요"·"저장하지 못했어요" 가 나오면 멈추고 보고한다.
|
||||
5. 검수(예외 없음): 만든 JPEG 전부를 **한 장씩 원본 크기로** Read 로 연다. 축소 시트로 판단하지 않는다. 볼 것: 글자 잘림·겹침, 그림 누락, 그림 속 사람·얼굴·글자, 코디는 그림 아래 옷 목록의 옷이 그림에 전부 있고 추가 옷이 없는지, 스냅 사진(`out/<날짜>/snaps/<사람>/snap.jpg`)과 옷·색이 같은지, 날씨 줄 수치가 예보와 맞는지. 틀리면 고치고 다시 찍어 다시 본다.
|
||||
6. 새 타로 그림이 생겼으면 `git add admin/src/assets/gak-card admin/src/assets/tarot-bg` 후 `feat: <날짜> 각 카드 그림(…)` 로 커밋한다 (Claude 서명 없이). 코디 그림(`admin/public/daily`)은 커밋하지 않는다.
|
||||
|
||||
@@ -3,8 +3,8 @@ description: 오늘의 코디 카드 4장(20-30대·40대~ 여·남, 스타일
|
||||
argument-hint: "<스타일> minimal(꾸안꾸)·casual·semi(오피스)·formal·street (비우면 minimal)"
|
||||
---
|
||||
|
||||
오늘의 코디 카드를 만들어 올린다. 인자: `$ARGUMENTS` — 코디 스타일 하나(minimal=꾸안꾸, casual=캐주얼, semi=세미정장·오피스, formal=정장, street=스트릿). 비어 있으면 minimal. 포스트 하나는 스타일 하나: 네 사람 모두 같은 스타일.
|
||||
재확인 질문 없이 순서대로 진행하고, 막히면 그 자리에서 보고하고 멈춘다. 검수를 통과한 뒤에만 올린다(올린 건 되돌릴 수 없다).
|
||||
오늘의 코디 저장소는 날씨각 저장소의 sns 워크트리다(맥: `~/orca/workspaces/o2o-weather/sns`, 다른 PC: 저장소를 받은 폴더). 어느 폴더에서 불러도 저장소 루트에서 작업하고, 아래 경로는 모두 저장소 루트 기준이다. 윈도우는 Git Bash 에서 같은 명령을 쓴다(처음 한 번 `admin/AGENTS.md` '윈도우' 준비). 카드를 만들어 올린다. 인자: `$ARGUMENTS` — 코디 스타일 하나(minimal=꾸안꾸, casual=캐주얼, semi=세미정장·오피스, formal=정장, street=스트릿). 비어 있으면 minimal. 포스트 하나는 스타일 하나: 네 사람 모두 같은 스타일.
|
||||
코디 구성 확인(2번)에서는 반드시 멈추고 사용자의 오케이를 기다린다. 그 밖에는 재확인 질문 없이 순서대로 진행하고, 막히면 그 자리에서 보고하고 멈춘다. 검수를 통과한 뒤에만 올린다(올린 건 되돌릴 수 없다).
|
||||
|
||||
## 꼭 지킬 것 (2026-10-27 사용자 피드백)
|
||||
- 에이블리는 공개 API 가 없어 쓸 수 없다. 요청에 있어도 처음에 그 사실을 말하고 무신사로만 만든다.
|
||||
@@ -12,15 +12,18 @@ argument-hint: "<스타일> minimal(꾸안꾸)·casual·semi(오피스)·formal
|
||||
- 계절감(가장 중요): 검수 때 아침·저녁 체감기온으로 '오늘 이 옷이면 춥지 않은가'를 사람마다 본다. 쌀쌀한 날(아침 체감과 낮 최고 평균 12도 미만, 스크립트 구간 chilly 이하)은 네 사람 모두 겉옷이 있어야 하고, 반팔 단독·미니 원피스/스커트·뮬·슬링백·샌들은 안 된다. 하나라도 걸리면 그 사람 스냅을 다시 고른다.
|
||||
- 여자 코디는 남성적·고프코어(카고 바지·백팩·등산화·바람막이)를 피하고 여성스러운 스냅을 고른다. 스트릿처럼 남성적인 스타일이 네 사람에게 안 어울리면 다른 스타일로 바꾼다.
|
||||
- 이름표는 한 줄에 들어가게 짧게(색 이름 접두어 빼기).
|
||||
- 인스타 API 가 `Application request limit reached` 를 돌려줘도 실제로는 올라갔을 수 있다. 다시 올리기 전에 `GET https://graph.instagram.com/v24.0/me/media?fields=permalink,caption,timestamp&limit=1` 로 최신 글 캡션을 확인하고, 없을 때만 다시 올린다(중복 게시 금지).
|
||||
- 남자 코디에 플레어(나팔)·부츠컷 바지는 쓰지 않는다(2026-10-28 사용자 피드백). 스냅 상품명이나 사진에 플레어·부츠컷·세미 부츠컷이 보이면 그 사람 스냅을 다시 고른다.
|
||||
- 올린 카드를 고쳐 다시 올리면 예전 날씨각 피드 포스트도 같이 지운다(2026-10-28 사용자 피드백). 삭제 API가 없어 운영 DB를 고치므로 명령·영향을 말하고 확인받은 뒤: `ssh King_admin 'docker exec o2o-weather-postgres-1 sh -c "psql -U \$POSTGRES_USER -d \$POSTGRES_DB -c \"update post set deleted = true where post_id = <예전 포스트>\""'` → `docker exec o2o-weather-redis-1 sh -c 'redis-cli --scan --pattern "feed:*" | xargs -r redis-cli del'` → `https://weather.o2o.kr/v1/feed?region=1114000000` 에 예전 포스트가 없고 새 포스트가 있는지 확인. 예전 인스타 글은 API로 못 지우니 사용자에게 앱에서 지워 달라고 한다.
|
||||
- 인스타 API 가 `Application request limit reached` 를 돌려줘도 실제로는 올라갔을 수 있다. 다시 올리기 전에 `GET https://graph.instagram.com/v24.0/me/media?fields=permalink,caption,timestamp&limit=1` 로(올리기 단계의 인스타 링크처럼 킹서버 토큰으로) 최신 글 캡션을 확인하고, 없을 때만 다시 올린다(중복 게시 금지).
|
||||
- 캡션 해시태그가 이 포스트 내용(주제·카드·스타일·계절)과 맞는지 본다. 고정 태그만 있으면 올리지 않는다(`admin/src/cards/templates.tsx` `post`).
|
||||
- 무엇을 왜 바꿨는지·되돌렸는지는 한 번에 구체적으로 설명한다(파일 이름만 말하지 않는다).
|
||||
|
||||
## 순서
|
||||
1. 관리자 서버: `curl -s http://localhost:5175/api/targets` 에 `king` 이 있어야 한다. 없으면 `admin/` 에서 백그라운드로 켠다 (`admin/AGENTS.md` '켜기', 킹서버 키는 `ssh King_admin` 의 `~/proj/o2o-weather/.env` `ADMIN_API_KEY`, 값은 출력하지 않는다).
|
||||
2. 만들기(승인 대기로 저장까지): `cd admin && VITE_API_BASE_URL=https://weather.o2o.kr ADMIN_URL=http://localhost:5175 npm run card -- ootd --daily --style <스타일> --color sky --post-wait`. 출력 끝의 `카드 N` 번호를 적어 둔다.
|
||||
무신사 인기 스냅 중 그 스타일 태그가 붙은 것에서 사람 4명 코디를 고르고(최근 14일에 쓴 스냅 제외), Claude 가 옷 목록을 뽑고, Codex 가 스냅 사진·상품 썸네일을 참고해 플랫레이 그림을 그린다(사람당 2~4분, 총 10~15분). 고른 스냅 주소·옷 목록이 출력된다. "스냅이 없어요"·"저장하지 못했어요"·"Codex 실행이 실패" 가 나오면 멈추고 보고한다. 로그의 `rmcp … AuthRequired` 는 Codex 내부 경고라 무시한다. 크롬이 한 장에서 45초 넘게 멈추면 그 프로세스를 죽이고 그 장만 다시 찍는다.
|
||||
3. 검수(예외 없음): 만든 JPEG 4장을 **한 장씩 원본 크기로** Read 로 연다. 축소 시트로 판단하지 않는다. 볼 것: 그림이 비어 있지 않은지, 그림 아래 옷 목록의 옷이 그림에 전부 있고 추가 옷이 없는지, 그림 속 사람·얼굴·글자, 스냅 사진(`admin/out/<날짜>/snaps/<사람>/snap.jpg`)과 옷·색이 같은지, 이름표 줄이 날씨 줄과 겹치지 않는지, 날씨 줄 수치가 예보(`https://weather.o2o.kr/v1/weather/today?region=1114000000`)와 맞는지. 틀리면 고치고 다시 만들어(2번, 새 카드 번호) 다시 본다. 못 고치면 올리지 말고 보고한다.
|
||||
4. 올리기(검수 통과 시): `curl -s -X POST "http://localhost:5175/api/cards/<카드 N>/publish?target=king"` → `post_id` 확인, 이어서 `curl -s -X POST --max-time 600 "http://localhost:5175/api/cards/<카드 N>/instagram?target=king"` → `ig_media_id`. 인스타 링크: `~/projects/o2o-weather/.env` 의 `INSTAGRAM_ACCESS_TOKEN` 으로 `GET https://graph.instagram.com/v24.0/<ig_media_id>?fields=permalink` (토큰 값은 출력하지 않는다).
|
||||
5. TODO.md 인스타 홍보 표에 한 줄(카드·포스트 번호, 인스타 링크, 참고 스냅 4개) 적고 `docs:` 커밋, `git push origin sns:main`. 코디 그림(`admin/public/daily`)은 커밋하지 않는다.
|
||||
6. 보고(한국어, 짧게): 인스타 링크, 킹서버 카드·포스트 번호, 참고한 스냅 주소 4개, 검수에서 고친 것, 남은 이슈.
|
||||
2. 코디 구성 확인 → **오케이 대기**: 오늘 구간을 정하고(아침 체감과 낮 최고 평균, `scripts/daily-ootd.mjs` weatherToday 와 같은 계산) `cd admin && node scripts/snap.mjs --band <구간> --style <스타일> --out out/<날짜>/snaps` 로 사람 4명 스냅을 고른다. `out/<날짜>/snaps/picks.json` 을 보고 나이대·성별마다(20-30대 여자·20-30대 남자·40대~ 여자·40대~ 남자) ① 입힐 옷(겉옷·상의·하의·신발·가방을 일반 이름으로) ② 가져온 곳(무신사 스냅 주소) ③ 계절감·위 규칙 점검 결과를 표로 보여 주고 AskUserQuestion 으로 오케이를 받는다. 각 사람 스냅 사진(`snaps/<사람>/snap.jpg`)을 Read 로 열어 사진 속 옷(바지 실루엣 포함)까지 확인한 뒤 보여 준다. 사용자가 특정 사람을 바꾸라고 하면 그 사람만 다시 골라 다시 보여 준다(다른 스냅을 고를 땐 `out/snap-history.json` 에 오늘 쓴 id 가 남으니 새 결과의 그 사람만 picks.json 에 옮긴다). 오케이 전에는 그림을 만들지 않는다.
|
||||
3. 만들기(승인 대기로 저장까지): `cd admin && VITE_API_BASE_URL=https://weather.o2o.kr ADMIN_URL=http://localhost:5175 npm run card -- ootd --daily --style <스타일> --color sky --post-wait`. 출력 끝의 `카드 N` 번호를 적어 둔다.
|
||||
2번에서 확인받은 `snaps/picks.json` 이 있으면 그 코디를 그대로 쓴다(없으면 무신사 인기 스냅에서 새로 고른다, 최근 14일에 쓴 스냅 제외). Claude 가 옷 목록을 뽑고, Codex 가 스냅 사진·상품 썸네일을 참고해 플랫레이 그림을 그린다(사람당 2~4분, 총 10~15분). 고른 스냅 주소·옷 목록이 출력된다. "스냅이 없어요"·"저장하지 못했어요"·"Codex 실행이 실패" 가 나오면 멈추고 보고한다. 로그의 `rmcp … AuthRequired` 는 Codex 내부 경고라 무시한다. 크롬이 한 장에서 45초 넘게 멈추면 `card.mjs` 가 그 장만 한 번 다시 찍는다(또 멈추면 멈추고 보고한다).
|
||||
4. 검수(예외 없음): 만든 JPEG 4장을 **한 장씩 원본 크기로** Read 로 연다. 축소 시트로 판단하지 않는다. 볼 것: 그림이 비어 있지 않은지, 그림 아래 옷 목록의 옷이 그림에 전부 있고 추가 옷이 없는지, 그림 속 사람·얼굴·글자, 스냅 사진(`admin/out/<날짜>/snaps/<사람>/snap.jpg`)과 옷·색이 같은지, 이름표 줄이 날씨 줄과 겹치지 않는지, 날씨 줄 수치가 예보(`https://weather.o2o.kr/v1/weather/today?region=1114000000`)와 맞는지. 틀리면 고치고 다시 만들어(3번, 새 카드 번호) 다시 본다. 못 고치면 올리지 말고 보고한다.
|
||||
5. 올리기(검수 통과 시): `curl -s -X POST "http://localhost:5175/api/cards/<카드 N>/publish?target=king"` → `post_id` 확인, 이어서 `curl -s -X POST --max-time 600 "http://localhost:5175/api/cards/<카드 N>/instagram?target=king"` → `ig_media_id`. 인스타 링크는 킹서버 토큰으로 본다: `ssh King_admin 'set -a; . ~/proj/o2o-weather/.env; set +a; curl -s "https://graph.instagram.com/v24.0/<ig_media_id>?fields=permalink&access_token=$INSTAGRAM_ACCESS_TOKEN"'` (토큰 값은 출력하지 않는다).
|
||||
6. `TODO.md` 인스타 홍보 표에 한 줄(카드·포스트 번호, 인스타 링크, 참고 스냅 4개) 적고 `docs:` 커밋, `git push origin sns:main`. 코디 그림(`admin/public/daily`)은 커밋하지 않는다.
|
||||
7. 보고(한국어, 짧게): 인스타 링크, 킹서버 카드·포스트 번호, 참고한 스냅 주소 4개, 검수에서 고친 것, 남은 이슈.
|
||||
@@ -3,24 +3,24 @@ description: 오늘의 날씨 타로 카드 5장을 만들어 검수하고 날
|
||||
argument-hint: "<타로 주제> 예) 건강 운동 · 연애 썸 · 경제 주식 (비우면 Claude가 고름)"
|
||||
---
|
||||
|
||||
오늘의 날씨 타로 카드를 만들어 올린다. 인자: `$ARGUMENTS` — 타로 주제(대주제 소주제). 비어 있으면 Claude 가 오늘 날씨에 맞는 주제를 고른다.
|
||||
재확인 질문 없이 순서대로 진행하고, 막히면 그 자리에서 보고하고 멈춘다. 검수를 통과한 뒤에만 올린다(올린 건 되돌릴 수 없다).
|
||||
오늘의 날씨 타로 저장소는 날씨각 저장소의 sns 워크트리다(맥: `~/orca/workspaces/o2o-weather/sns`, 다른 PC: 저장소를 받은 폴더). 어느 폴더에서 불러도 저장소 루트에서 작업하고, 아래 경로는 모두 저장소 루트 기준이다. 윈도우는 Git Bash 에서 같은 명령을 쓴다(처음 한 번 `admin/AGENTS.md` '윈도우' 준비). 카드를 만들어 올린다. 인자: `$ARGUMENTS` — 타로 주제(대주제 소주제). 비어 있으면 Claude 가 오늘 날씨에 맞는 주제를 고른다.
|
||||
기획 문구 검토(3번)에서는 반드시 멈추고 사용자의 오케이를 기다린다(2026-10-28 사용자 요청: 만들어 올리지 말고 내용부터 검토받는다). 그 밖에는 재확인 질문 없이 순서대로 진행하고, 막히면 그 자리에서 보고하고 멈춘다. 검수를 통과한 뒤에만 올린다(올린 건 되돌릴 수 없다).
|
||||
|
||||
## 꼭 지킬 것 (2026-10-27 사용자 피드백)
|
||||
- 카드는 주제와 직접 엮여야 한다. 경제(주식·재테크) 주제는 경제 전용 카드(`admin/money-deck.json`: 불장·존버·분할매수·익절·손절·관망·물타기·배당·적금·텅장)에서만 고르고, 리딩은 돈·주식 이야기로 쓴다. 산책·꽃구경 같은 활동 이야기로 새면 다시 기획한다.
|
||||
- 주식 주제의 제목·질문은 "오늘 내 주식"(계좌·지갑처럼 돌려 말하지 않는다).
|
||||
- 예보 데이터에 없는 사실(바람 세기 등)은 쓰지 않는다. 행운 포인트의 시각·기온은 그 시각 slot 값 그대로(예: 해 질 녘 18시 10도를 8도로 쓰지 않는다).
|
||||
- 카드 그림을 계절에 맞출 필요는 없다(가을에 벚꽃 그림이어도 다시 그리지 않는다).
|
||||
- 인스타 API 가 `Application request limit reached` 를 돌려줘도 실제로는 올라갔을 수 있다. 다시 올리기 전에 `GET https://graph.instagram.com/v24.0/me/media?fields=permalink,caption,timestamp&limit=1` 로 최신 글 캡션을 확인하고, 없을 때만 다시 올린다(중복 게시 금지).
|
||||
- 인스타 API 가 `Application request limit reached` 를 돌려줘도 실제로는 올라갔을 수 있다. 다시 올리기 전에 `GET https://graph.instagram.com/v24.0/me/media?fields=permalink,caption,timestamp&limit=1` 로(올리기 단계의 인스타 링크처럼 킹서버 토큰으로) 최신 글 캡션을 확인하고, 없을 때만 다시 올린다(중복 게시 금지).
|
||||
- 캡션 해시태그가 이 포스트 내용(주제·카드·스타일·계절)과 맞는지 본다. 고정 태그만 있으면 올리지 않는다(`admin/src/cards/templates.tsx` `post`).
|
||||
- 무엇을 왜 바꿨는지·되돌렸는지는 한 번에 구체적으로 설명한다(파일 이름만 말하지 않는다).
|
||||
|
||||
## 순서
|
||||
1. 관리자 서버: `curl -s http://localhost:5175/api/targets` 에 `king` 이 있어야 한다. 없으면 `admin/` 에서 백그라운드로 켠다 (`admin/AGENTS.md` '켜기', 킹서버 키는 `ssh King_admin` 의 `~/proj/o2o-weather/.env` `ADMIN_API_KEY`, 값은 출력하지 않는다).
|
||||
2. 예보: `curl -s "https://weather.o2o.kr/v1/weather/today?region=1114000000"` 의 `day` 가 오늘인지 보고 slots 의 기온·하늘·비 확률을 적어 둔다.
|
||||
3. 만들기(승인 대기로 저장까지): `cd admin && VITE_API_BASE_URL=https://weather.o2o.kr ADMIN_URL=http://localhost:5175 npm run card -- tarot --topic "<주제>" --color sky --post-wait` (주제가 없으면 `--topic` 없이). 출력 끝의 `카드 N` 번호를 적어 둔다.
|
||||
출력된 기획 문구를 2의 예보와 대조한다(숫자·하늘 묘사가 틀리면 `--copy <값> --feedback "실제 수치…"` 로 한 번만 다시). 빠진 각 카드 그림은 Codex 가 자동으로 만든다(장당 1~5분). "일부 그림을 못 만들어" 가 나오면 멈추고 보고한다. 크롬이 한 장에서 45초 넘게 멈추면 그 프로세스를 죽이고 그 장만 다시 찍는다.
|
||||
4. 검수(예외 없음): 만든 JPEG 5장을 **한 장씩 원본 크기로** Read 로 연다. 축소 시트로 판단하지 않는다. 볼 것: 글자 잘림·겹침, 카드 그림 누락, 그림 속 사람·글자, 리딩 문구의 수치·하늘 묘사가 예보와 맞는지, 말투(3문장, "~할 수 있어요" 남발·덕담 금지). 틀리면 고치고 다시 만들어(3번, 새 카드 번호) 다시 본다. 못 고치면 올리지 말고 보고한다.
|
||||
5. 올리기(검수 통과 시): `curl -s -X POST "http://localhost:5175/api/cards/<카드 N>/publish?target=king"` → `post_id` 확인, 이어서 `curl -s -X POST --max-time 600 "http://localhost:5175/api/cards/<카드 N>/instagram?target=king"` → `ig_media_id`. 인스타 링크: `~/projects/o2o-weather/.env` 의 `INSTAGRAM_ACCESS_TOKEN` 으로 `GET https://graph.instagram.com/v24.0/<ig_media_id>?fields=permalink` (토큰 값은 출력하지 않는다).
|
||||
6. 새 그림이 생겼으면 `git add admin/src/assets/gak-card admin/src/assets/tarot-bg` 후 `feat: <날짜> 각 카드 그림(…)` 로 커밋한다 (Claude 서명 없이). TODO.md 인스타 홍보 표에 한 줄(카드·포스트 번호, 인스타 링크) 적고 `docs:` 커밋, `git push origin sns:main`.
|
||||
7. 보고(한국어, 짧게): 인스타 링크, 킹서버 카드·포스트 번호, 새 그림 수, 검수에서 고친 것, 남은 이슈.
|
||||
3. 기획 → **오케이 대기**: 그림·카드를 만들기 전에 문구만 기획한다. `cd admin && mkdir -p out/<날짜> && node -e 'require("fs").writeFileSync(process.argv[2], JSON.stringify({template:"tarot",topic:process.argv[1],feedback:"",current:{}}))' "<주제>" out/<날짜>/plan-req.json && curl -s -X POST http://localhost:5175/api/plan -H 'Content-Type: application/json' --data-binary @out/<날짜>/plan-req.json > out/<날짜>/tarot-plan.json` (주제가 없으면 `""`. 한글이 윈도우 명령줄에서 깨지지 않게 요청 본문은 파일로 보낸다. 다시 기획할 때도 같은 파일에 feedback·current 를 넣어 보낸다). 결과 `copy` 를 2의 예보와 대조하고(숫자·하늘 묘사·예보에 없는 사실), 틀리면 `feedback` 에 실제 수치를 넣고 `current` 에 직전 copy 를 넣어 한 번 다시 기획한다. 그다음 사용자에게 주제·표지 질문·카드 3장(각 이름)·장마다 리딩·행운 포인트·캡션 해시태그를 그대로 보여 주고 AskUserQuestion 으로 오케이를 받는다. 고치라고 하면 그 말을 `feedback` 으로 다시 기획해 다시 보여 준다. 오케이 전에는 그림을 만들지 않는다.
|
||||
4. 만들기(승인 대기로 저장까지): 오케이받은 copy 에 `theme` 를 넣어 base64url 로 바꾸고(`node -e 'const c=JSON.parse(require("fs").readFileSync("out/<날짜>/tarot-plan.json","utf8")).copy;c.theme="sky";console.log(Buffer.from(JSON.stringify(c)).toString("base64url"))'`) `VITE_API_BASE_URL=https://weather.o2o.kr ADMIN_URL=http://localhost:5175 npm run card -- tarot --copy <값> --post-wait` 로 그 문구 그대로 그린다(`--topic`·`--feedback` 을 주면 다시 기획되니 넣지 않는다). 오늘 고른 카드 코드(c1·c2·c3)를 `out/tarot-history.json` 의 오늘 날짜에 더한다(다음 7일 다른 카드가 나오게, card.mjs 기획 때 하던 일). 출력 끝의 `카드 N` 번호를 적어 둔다. 빠진 각 카드 그림은 Codex 가 자동으로 만든다(장당 1~5분). "일부 그림을 못 만들어" 가 나오면 멈추고 보고한다. 크롬이 한 장에서 45초 넘게 멈추면 `card.mjs` 가 그 장만 한 번 다시 찍는다(또 멈추면 멈추고 보고한다).
|
||||
5. 검수(예외 없음): 만든 JPEG 5장을 **한 장씩 원본 크기로** Read 로 연다. 축소 시트로 판단하지 않는다. 볼 것: 글자 잘림·겹침, 카드 그림 누락, 그림 속 사람·글자, 리딩 문구의 수치·하늘 묘사가 예보와 맞는지, 말투(3문장, "~할 수 있어요" 남발·덕담 금지). 틀리면 고치고 다시 만들어(4번, 새 카드 번호) 다시 본다. 못 고치면 올리지 말고 보고한다.
|
||||
6. 올리기(검수 통과 시): `curl -s -X POST "http://localhost:5175/api/cards/<카드 N>/publish?target=king"` → `post_id` 확인, 이어서 `curl -s -X POST --max-time 600 "http://localhost:5175/api/cards/<카드 N>/instagram?target=king"` → `ig_media_id`. 인스타 링크는 킹서버 토큰으로 본다: `ssh King_admin 'set -a; . ~/proj/o2o-weather/.env; set +a; curl -s "https://graph.instagram.com/v24.0/<ig_media_id>?fields=permalink&access_token=$INSTAGRAM_ACCESS_TOKEN"'` (토큰 값은 출력하지 않는다).
|
||||
7. 새 그림이 생겼으면 `git add admin/src/assets/gak-card admin/src/assets/tarot-bg` 후 `feat: <날짜> 각 카드 그림(…)` 로 커밋한다 (Claude 서명 없이). `TODO.md` 인스타 홍보 표에 한 줄(카드·포스트 번호, 인스타 링크) 적고 `docs:` 커밋, `git push origin sns:main`.
|
||||
8. 보고(한국어, 짧게): 인스타 링크, 킹서버 카드·포스트 번호, 새 그림 수, 검수에서 고친 것, 남은 이슈.
|
||||
@@ -27,18 +27,36 @@ $ARGUMENTS 가 있으면 위 목록에 더한다.
|
||||
|
||||
## 4. 기록
|
||||
|
||||
- `docs/검색노출_기록.md` 표 맨 아래에 오늘 날짜 행을 더한다. 형식은 파일 안 표를 따른다.
|
||||
- `docs/검색_노출.md` 5장(노출 기록)의 '기록' 표 맨 아래에 오늘 날짜 행을 더한다. 형식은 그 표를 따른다.
|
||||
- 어제 행과 비교해 바뀐 것(새로 잡힘·빠짐·순위 변화·색인 주소 수)을 뽑는다.
|
||||
|
||||
## 5. 다음 할 일 제안
|
||||
## 5. 원인 분석 (빠짐·순위 하락이 하나라도 있으면 반드시)
|
||||
|
||||
- 근거는 공식 문서만 쓴다: `docs/구글_검색_정책_리서치.md`, 구글 Search Central, 네이버 서치어드바이저 가이드. 문서에 없는 건 "문서에 없음"이라 쓰고, 판단·추정은 따로 표시한다.
|
||||
숫자만 보고하고 끝내지 않는다. 왜 그렇게 됐는지 아래를 직접 확인하고, 확인한 것·배제한 것·남은 가설을 나눠 적는다.
|
||||
|
||||
- 페이지 상태: 빠진 주소를 Googlebot·Yeti UA 로 curl 해 상태 코드·title·canonical·robots meta, robots.txt 를 본다.
|
||||
- 렌더 뒤 화면: 구글은 JS 실행 뒤 HTML 로 색인한다. 헤드리스 Chrome(`--headless=new --virtual-time-budget=20000 --dump-dom`, Googlebot UA)으로 렌더해 h1·검색어 문구·자주 묻는 질문이 남는지 센다.
|
||||
- 색인 여부: 구글·네이버 `site:weather.o2o.kr <지역>` 에 그 주소가 있는지. 없으면 색인 문제, 있으면 순위 문제.
|
||||
- 봇 방문: `ssh King_admin 'docker logs --since 72h o2o-weather-frontend-1'` 에서 Googlebot·Yeti 가 그 주소를 받았는지·상태 코드.
|
||||
- 바뀐 것: 직전 측정 이후 `git log --since=<직전 측정일> -- frontend backend` 로 그 페이지 화면·제목·사이트맵에 닿은 커밋을 찾는다. 배포 시각과 측정 시각의 앞뒤를 맞춘다.
|
||||
- 사이트 안 경쟁: `site:` 결과에 같은 검색어를 두고 겹치는 다른 주소(예: /shorts/*)가 있는지.
|
||||
- 측정 잡음: 직전 순위가 구글 2p·네이버 10위 밖처럼 경계였는지, 직전 측정이 실패(`?`)였는지.
|
||||
|
||||
## 6. 대안 제시
|
||||
|
||||
- 원인마다 고칠 방법 1~3개와 추천 하나, 각 방법의 근거(공식 문서 또는 위에서 확인한 사실)와 예상 효과·단점을 쓴다.
|
||||
- 고칠지는 AskUserQuestion 으로 묻고, 고르면 그대로 고친다.
|
||||
|
||||
## 7. 다음 할 일 제안
|
||||
|
||||
- 근거는 공식 문서만 쓴다: `docs/검색_노출.md` 4장(구글 검색 정책), 구글 Search Central, 네이버 서치어드바이저 가이드. 문서에 없는 건 "문서에 없음"이라 쓰고, 판단·추정은 따로 표시한다.
|
||||
- 같은 페이지를 매일 수집 요청하지 않는다(네이버: 반영에 1일~몇 주, 매일 반복 불필요).
|
||||
- 바꾼 뒤 결과는 몇 주 단위로 본다(구글: 변경 반영에 몇 시간~몇 달). 하루 변화로 원인을 단정하지 않는다.
|
||||
- 코드·문구 수정이 필요하면 고치지 말고 제안만 하고, 결정이 필요한 건 `TODO.md`에 적는다.
|
||||
|
||||
## 6. 보고 (채팅, 짧게)
|
||||
## 8. 보고 (채팅, 짧게)
|
||||
|
||||
- 바뀐 것 3줄 이내
|
||||
- 검색어별 구글/네이버 순서 (없음·차단 포함)
|
||||
- 빠짐·하락의 원인 분석(확인한 것·배제한 것·가설)과 대안·추천
|
||||
- 다음 할 일 1~3개 (근거 출처 포함)
|
||||
@@ -16,18 +16,18 @@ argument-hint: "<나이대> 20·30·40 [스타일] minimal·casual·semi·formal
|
||||
- 움직임: 춤추지 않는다. 원래 자세에서 바람에 머리·옷이 날리고 손인사·머리 넘기기·옷깃 만지기 같은 작은 동작 하나만(`templates/actions.json`). 손가락 모양 동작(하트·V·OK·엄지)은 영상에서 다른 손 모양이 되니 쓰지 않는다. 낙엽 떨어지는 효과는 넣지 않는다. 여자는 키가 커 보이지 않게(158cm 정도, 머리:몸 1:7, 눈높이 카메라).
|
||||
- 화면: 프로필 그리드는 가운데 3:4(위 240 ~ 아래 1680), 피드는 4:5(위 285 ~ 아래 1635)만 보여 준다. 둥근 영상 창(132,240 · 816×1440)이 3:4 를 채우고 바깥은 같은 영상을 흐리게 깔아 빈 곳이 없게 한다. 칩·제목·자막은 창 왼쪽 아래, 4:5 안에 둔다. `templates/frame.html`·`title.html`·`bubble.html`·`scripts/compose.sh` 의 창 위치를 바꾸지 않는다.
|
||||
- 킹서버: 영상은 날씨각 전용 컨테이너 `nalssigak-ltx`(GPU 0)로만 만든다. menusong 서비스·파일은 건드리지 않는다. `server.sh down` 이 끌 때 서버의 입력·결과 파일을 지운다.
|
||||
- 비밀: OAuth·토큰은 `~/.config/nalssigak/`, 인스타 토큰은 `.env`. 값을 출력하거나 저장소에 넣지 않는다.
|
||||
- 비밀: OAuth·토큰은 `~/.config/nalssigak/`, 인스타 토큰은 킹서버 `.env`. 값을 출력하거나 저장소에 넣지 않는다.
|
||||
|
||||
## 환경 점검 (1번에서 돌리고, 안 되면 해결 방법을 알려 준다)
|
||||
| 점검 | 명령 | 안 될 때 |
|
||||
|---|---|---|
|
||||
| 기본 도구 | `python3 --version; node --version; ffmpeg -version; ls "/Applications/Google Chrome.app"` | 없는 것을 설치한다(`brew install ffmpeg` 등). 크롬은 앱으로 설치. |
|
||||
| 기본 도구 | `${PYTHON:-python3} --version; node --version; ffmpeg -version; node -e "import('./admin/scripts/bin.mjs').then(m=>console.log(require('fs').existsSync(m.CHROME)?'chrome ok':'chrome 없음: '+m.CHROME))"` | 없는 것을 설치한다. 맥 `brew install ffmpeg webp`, 윈도우는 `admin/AGENTS.md` '윈도우'(winget 으로 Git·Node·Python·ffmpeg·Chrome). 크롬이 다른 곳에 있으면 `CHROME_PATH`. |
|
||||
| Codex(사진) | `codex --version` | Codex CLI 를 설치하고 `codex login`. 사용 한도 초과면 다음 날 다시. |
|
||||
| 관리자 서버(인스타) | `curl -s http://localhost:5175/api/targets` 에 `king` | `admin/` 에서 `npm install` 후 `admin/AGENTS.md` '켜기'대로 백그라운드로 켠다(킹서버 키는 `ssh King_admin` 의 `~/proj/o2o-weather/.env` `ADMIN_API_KEY`, 값은 출력하지 않는다). |
|
||||
| 킹서버 접속 | `ssh -o BatchMode=yes King_admin true` | `~/.ssh/config` 에 `Host King_admin`(HostName 172.30.1.36, User o2oadmin, ProxyJump Confluence)과 키가 있어야 한다. 사내망·키는 사용자가 확인. |
|
||||
| 영상 서버 | `admin/nalssigak/scripts/server.sh status` | 이미지 `jw/comfyui-ltx:latest`·모델 `/mnt/data2/dir/jw_playground/LTX-2.5` 가 서버에 있어야 한다(없으면 서버 담당자에게). GPU 0 을 menusong 이 쓰면 기다리거나 `OOTD_GPU=1`. |
|
||||
| YouTube 앱 | `ls ~/.config/nalssigak/client_secret.json` | Google Cloud 의 YouTube Data API v3 프로젝트에서 OAuth 클라이언트(데스크톱 앱) JSON 을 받아 그 경로에 두고 `chmod 600`. |
|
||||
| YouTube 로그인 | `ls ~/.config/nalssigak/youtube_token.json` | `python3 admin/nalssigak/scripts/youtube.py auth` → 사용자가 채널 계정으로 로그인. 'access_denied' 면 Google 인증 플랫폼 → 대상 → 테스트 사용자에 그 계정을 추가. 업로드 때 `invalid_grant` 면 토큰 만료(테스트 앱은 7일)라 auth 를 다시 하고, 앱을 '프로덕션으로 게시'하길 권한다. |
|
||||
| YouTube 로그인 | `ls ~/.config/nalssigak/youtube_token.json` | `${PYTHON:-python3} admin/nalssigak/scripts/youtube.py auth` → 사용자가 채널 계정으로 로그인. 'access_denied' 면 Google 인증 플랫폼 → 대상 → 테스트 사용자에 그 계정을 추가. 업로드 때 `invalid_grant` 면 토큰 만료(테스트 앱은 7일)라 auth 를 다시 하고, 앱을 '프로덕션으로 게시'하길 권한다. |
|
||||
| 인스타 토큰 | 킹서버 `.env` 의 `INSTAGRAM_ACCESS_TOKEN`·`INSTAGRAM_USER_ID` 가 있는지(값은 보지 않고 `grep -c`) | 없거나 만료면 `TODO.md` '인스타 연결' 행 순서대로 다시 발급해 킹서버 `.env` 에 넣는다(사용자 작업). |
|
||||
|
||||
## 순서
|
||||
@@ -35,24 +35,24 @@ argument-hint: "<나이대> 20·30·40 [스타일] minimal·casual·semi·formal
|
||||
2. 날씨: `curl -s "https://weather.o2o.kr/v1/weather/today?region=1114000000"` 의 `slots` 중 6~21시로 아침(6시)·낮 최고 기온, 비(rain_type≠0 또는 rain_prob≥60), 하늘을 잡는다. 구간은 낮 최고로 hot≥28 · warm≥23 · mild≥17 · cool≥12 · chilly≥9 · cold≥5 · 그 아래 freezing. 배경 문장은 계절·날씨에 맞게 한 줄로(예: 맑은 가을이면 "a sunny clear late-October afternoon on a Seoul tree-lined sidewalk with golden ginkgo trees…", 비 오면 젖은 거리·우산).
|
||||
3. 코디: `cd admin && node scripts/snap.mjs --band <구간> --style <스타일> --out nalssigak/runs/<W 이름>/snaps`. 20·30 은 `f20`·`m20`, 40 은 `f40`·`m40` 을 쓴다. `snaps/picks.json` 의 상품(outer·top·bottom·shoes·bag)을 보고 위 계절감 규칙에 맞는지 본다. 안 맞으면 `--pages 3` 등으로 다시 고른다.
|
||||
4. 사진: `models/models.json` 에서 그 나이대(20·30 → 20s, 40 → 40s) 여자·남자를 하나씩 무작위로 고른다. `templates/photo_prompt.txt` 를 채워 `W/woman_photo.txt`·`W/man_photo.txt` 를 쓰고(옷은 태그된 상품을 색·소재·실루엣까지 영어로, 여자는 body_line 에 키 규칙), 둘을 동시에 만든다:
|
||||
`python3 admin/nalssigak/scripts/codex_image.py --prompt-file W/woman_photo.txt --output W/woman_photo.png --image admin/nalssigak/models/<id>.jpg --image W/snaps/f20/snap.jpg --image W/snaps/f20/goods-<n>.jpg …` (남자도 같게, 1~2분).
|
||||
`${PYTHON:-python3} admin/nalssigak/scripts/codex_image.py --prompt-file W/woman_photo.txt --output W/woman_photo.png --image admin/nalssigak/models/<id>.jpg --image W/snaps/f20/snap.jpg --image W/snaps/f20/goods-<n>.jpg …` (남자도 같게, 1~2분).
|
||||
5. 사진 검수 → **승인 대기**: 모델 기준 사진과 나란히 붙인 시트를 열어 보여 준다. 볼 것: 같은 얼굴인지, 태그된 옷이 다 있고 없는 옷이 없는지, 글자·워터마크, 전신(머리~신발, 신발 아래 여백), 손, 키 비율. 사용자가 고치라고 하면 그 사진만 다시 만든다.
|
||||
6. 동작 설명: 동작은 사람마다 무작위로 두 개를 고른다 — `python3 admin/nalssigak/scripts/actions.py --who woman --has outer,bag` (그 사람에게 겉옷·가방이 있을 때만 `--has` 에 넣는다, 남자는 `--who man`). 출력 첫 줄을 `W/woman_a.txt`, 둘째 줄을 `W/woman_b.txt` 의 `{action}` 에 그대로 넣어 `templates/motion_prompt.txt` 를 채운다(남자는 `W/man_a.txt`·`W/man_b.txt`). 손가락 모양 동작을 따로 덧붙이지 않는다.
|
||||
6. 동작 설명: 동작은 사람마다 무작위로 두 개를 고른다 — `${PYTHON:-python3} admin/nalssigak/scripts/actions.py --who woman --has outer,bag` (그 사람에게 겉옷·가방이 있을 때만 `--has` 에 넣는다, 남자는 `--who man`). 출력 첫 줄을 `W/woman_a.txt`, 둘째 줄을 `W/woman_b.txt` 의 `{action}` 에 그대로 넣어 `templates/motion_prompt.txt` 를 채운다(남자는 `W/man_a.txt`·`W/man_b.txt`). 손가락 모양 동작을 따로 덧붙이지 않는다.
|
||||
7. 클립: `admin/nalssigak/scripts/clips.sh W` (4초 4개, 하나에 4~5분, 총 20분 안팎). GPU 0 을 menusong 이 쓰고 있다며 시작하지 않으면 기다렸다 다시 하거나 비어 있으면 `OOTD_GPU=1` 로 한다.
|
||||
8. 클립 검수: 클립마다 `ffmpeg -vf "select='eq(n\,12)+eq(n\,36)+eq(n\,60)+eq(n\,84)',tile=4x1"` 로 얼굴을 확대해 본다. 눈 감음·고개 젖힘·얼굴 바뀜·손가락 뭉개짐·카메라 움직임이 있으면 그 클립만 `clips.sh W woman_b` 처럼 다시 만든다(최대 2번).
|
||||
9. 합성:
|
||||
- 타이틀: `python3 admin/nalssigak/scripts/render.py title --age <20|30|40~> --who 여성 --label <코디|하객룩 …> --out W/title_woman.png` (남성도). 제목은 '이번주 20대 / 여성 하객룩' 두 줄로 창 왼쪽 아래에 얹힌다.
|
||||
- 타이틀: `${PYTHON:-python3} admin/nalssigak/scripts/render.py title --age <20|30|40~> --who 여성 --label <코디|하객룩 …> --out W/title_woman.png` (남성도). 제목은 '이번주 20대 / 여성 하객룩' 두 줄로 창 왼쪽 아래에 얹힌다.
|
||||
- 자막 4개: 그날 옷에서 한 줄로 짧게(20자 안팎, 옷 이름은 `*강조*`). 문구는 목록으로 먼저 확인받는다. 제목 아래 같은 자리(창 왼쪽, 발 바로 위 다리 높이)에 차례로 나오고, 창 오른쪽(948px)을 넘으면 문구를 줄인다. 자막·제목이 신발을 가리면 안 된다.
|
||||
`python3 admin/nalssigak/scripts/render.py bubble --text "…" --out W/bubbles/w1.png`, `W/bubbles.txt` 에 `w1 0.8 3.0` · `w2 3.4 6.1` · `m1 7.1 9.4` · `m2 9.8 12.4`.
|
||||
- 음악: `admin/nalssigak/music.json` 에서 직전 회차(`runs/*/publish.md` 의 Music 줄)와 다른 곡을 골라 `admin/nalssigak/runs/cache/music/<id>.mp3` 에 없으면 내려받는다. 새 곡은 Mixkit Stock Music Free License 곡을 후보로 영상에 입혀 들려 주고 사용자가 고른 것만 넣는다.
|
||||
- `admin/nalssigak/scripts/compose.sh W admin/nalssigak/runs/cache/music/<id>.mp3` → `W/final.mp4` (15초).
|
||||
`${PYTHON:-python3} admin/nalssigak/scripts/render.py bubble --text "…" --out W/bubbles/w1.png`, `W/bubbles.txt` 에 `w1 0.8 3.0` · `w2 3.4 6.1` · `m1 7.1 9.4` · `m2 9.8 12.4`.
|
||||
- 음악: `${PYTHON:-python3} admin/nalssigak/scripts/music.py` 가 `admin/nalssigak/music.json` 에서 최근 4편(`runs/*/publish.md` 의 Music 줄)에 쓴 곡을 빼고 무작위로 골라, 캐시에 없으면 내려받고 `mp3 경로 credit` 을 출력한다. 그 경로를 아래 compose.sh 에, credit 을 publish.md 에 쓴다. 같은 날 여러 나이대를 만들면 편마다 다시 돌린다. 새 곡은 Mixkit Stock Music Free License 곡을 후보로 영상에 입혀 들려 주고 사용자가 고른 것만 넣는다.
|
||||
- `admin/nalssigak/scripts/compose.sh W <music.py 가 출력한 mp3 경로>` → `W/final.mp4` (15초).
|
||||
- 확인: `admin/nalssigak/scripts/sheet.sh W/final.mp4 W/sheet.png 1.0 1.9 2.8 3.7 4.7 5.8 7.4 8.3 9.2 10.1 11.1 12.2 13.8` 로 자막·제목이 얼굴을 가리지 않는지 보고, `crop=1080:1440:0:240`(그리드)·`crop=1080:1350:0:285`(피드)로 잘라 칩·제목·자막·머리·신발이 다 보이는지 본다.
|
||||
10. 문구 → **승인 대기**: `W/publish.md` 에 YouTube 제목(`이번주 <나이>대 <계절> 코디 🍂 여자·남자 데일리룩 | 날씨각 #Shorts` 꼴, 나이는 타이틀과 같게 `20대`·`30대`·`40대~` — 40 은 반드시 `40대~`. 제목·설명·인스타 캡션 첫 줄 모두 같다)·설명(사람별 옷 목록 — 옷 이름은 '다크 브라운 스웨이드 블루종'·'와이드 치노 팬츠'처럼 색·소재·종류로만 쓴다, weather.o2o.kr, "※ 영상 속 인물은 AI로 만든 가상 모델이에요." 와 음악 credit, 해시태그)·태그, 인스타 캡션(첫 줄이 제목, 프로필 링크 → weather.o2o.kr, 토스 '날씨각' 검색 안내, AI 표기, 해시태그)을 쓴다. 해시태그는 나이대·스타일·계절에 맞춘다. 영상을 열고 문구 전체를 보여 준 뒤 "올려" 를 기다린다.
|
||||
11. 올리기(승인 후):
|
||||
- 인스타: 1초 프레임을 `W/cover.jpg` 로 뽑고, `POST http://localhost:5175/api/reel?target=king` 에 `{title, caption, hashtags, video(mp4 base64, 30MB 이하), cover(JPEG base64)}` → `reel_id`, 이어서 `POST http://localhost:5175/api/reel/<reel_id>/instagram?target=king` (`--max-time 600`) → `ig_media_id`. 링크는 `GET https://graph.instagram.com/v24.0/<ig_media_id>?fields=permalink,media_product_type` (토큰은 `~/projects/o2o-weather/.env` 또는 킹서버 `~/proj/o2o-weather/.env` 의 `INSTAGRAM_ACCESS_TOKEN`, 출력하지 않는다). `Application request limit reached` 면 `me/media?fields=permalink,caption,timestamp&limit=1` 로 이미 올라갔는지 보고, 없을 때만 다시 올린다.
|
||||
- YouTube: `W/youtube_meta.json` 에 `{title, description, tags, privacy}` 를 쓰고 `python3 admin/nalssigak/scripts/youtube.py upload W/final.mp4 W/youtube_meta.json`. 토큰이 없거나 만료면 `youtube.py auth` 로 사용자에게 채널 계정 로그인을 받는다(계정이 Google 인증 플랫폼 테스트 사용자여야 한다).
|
||||
- 인스타: 1초 프레임을 `W/cover.jpg` 로 뽑고, `POST http://localhost:5175/api/reel?target=king` 에 `{title, caption, hashtags, video(mp4 base64, 30MB 이하), cover(JPEG base64)}` 를 node 로 파일을 읽어 fetch 로 보낸다(명령줄에 base64 를 넣지 않는다, 윈도우 명령줄 길이 제한) → `reel_id`, 이어서 `POST http://localhost:5175/api/reel/<reel_id>/instagram?target=king` (`--max-time 600`) → `ig_media_id`. 링크는 `GET https://graph.instagram.com/v24.0/<ig_media_id>?fields=permalink,media_product_type` 를 킹서버 토큰으로 본다(`ssh King_admin 'set -a; . ~/proj/o2o-weather/.env; set +a; curl -s "…&access_token=$INSTAGRAM_ACCESS_TOKEN"'`, 출력하지 않는다). `Application request limit reached` 면 `me/media?fields=permalink,caption,timestamp&limit=1` 로 이미 올라갔는지 보고, 없을 때만 다시 올린다.
|
||||
- YouTube: `W/youtube_meta.json` 에 `{title, description, tags, privacy}` 를 쓰고 `${PYTHON:-python3} admin/nalssigak/scripts/youtube.py upload W/final.mp4 W/youtube_meta.json`. 토큰이 없거나 만료면 `youtube.py auth` 로 사용자에게 채널 계정 로그인을 받는다(계정이 Google 인증 플랫폼 테스트 사용자여야 한다).
|
||||
- privacy: `~/.config/nalssigak/youtube_public` 파일이 있으면 `"public"`(API 감사 통과 뒤), 없으면 `"private"`. 감사 전에는 절대 public 으로 보내지 않는다(비공개로 잠길 수 있다).
|
||||
- 바로 반영: 비공개로 올렸으면 출력의 `studio` 주소를 `open` 으로 열고, 사용자에게 "공개 범위 → 공개 → 저장" 만 하면 된다고 알린다. 사용자가 공개로 바꿨다고 하면 `https://youtube.com/shorts/<id>` 링크를 다시 알려 주고 마친다.
|
||||
- 바로 반영: 비공개로 올렸으면 출력의 `studio` 주소를 브라우저로 열고(맥 `open`, 윈도우 `start "" <주소>`), 사용자에게 "공개 범위 → 공개 → 저장" 만 하면 된다고 알린다. 사용자가 공개로 바꿨다고 하면 `https://youtube.com/shorts/<id>` 링크를 다시 알려 주고 마친다.
|
||||
- public 으로 보냈는데 출력에 경고(요청과 다른 공개 상태)가 나오면 감사가 풀린 게 아니므로 `youtube_public` 파일을 지우라고 알리고, 스튜디오에서 상태를 확인하게 한다.
|
||||
- 감사 신청은 YouTube API Services 감사·할당량 양식(https://support.google.com/youtube/contact/yt_api_form)으로 사용자가 한다.
|
||||
12. 보고(한국어, 짧게): 인스타·YouTube 링크, 쓴 모델·스냅 주소, 검수에서 다시 만든 것, 남은 일(YouTube 는 비공개로 올라가니 스튜디오에서 공개 전환, 인스타는 앱에서 'AI 정보' 라벨 켜기).
|
||||
@@ -0,0 +1,75 @@
|
||||
---
|
||||
name: ga-report
|
||||
description: 날씨각 GA4 와 운영 DB 숫자로 지난 기간 사용 현황을 분석해 바뀐 것·원인·다음 할 일을 짧게 보고한다
|
||||
argument-hint: "<일수> 예) 7 · 28 (비우면 7일)"
|
||||
---
|
||||
|
||||
날씨각(weather.o2o.kr·토스판) 사용 현황을 GA4 와 운영 DB 로 보고, 바로 앞 같은 길이 기간과 비교해 판단과 다음 할 일을 낸다. 인자 `$ARGUMENTS` = 일수(비우면 7). 기간은 어제까지(오늘은 하루가 안 끝나 뺀다). 아래 경로는 모두 저장소 루트 기준이다.
|
||||
|
||||
## 0. 처음 한 번 (PC마다)
|
||||
|
||||
- GA 키: 팀에서 받은 JSON 을 저장소 원본 폴더의 `secrets/ga-key.json` 으로 둔다(`secrets/` 는 `.gitignore` 라 커밋되지 않는다). 키는 사람마다 따로 발급한다(GCP `nalssigak` → 서비스 계정 `nalssigak-ga` → 키 추가). 키를 메신저·메일·git 으로 다시 돌리지 않는다.
|
||||
- `uv` 가 없으면 `brew install uv`.
|
||||
- 키가 없으면 1번 스크립트가 "GA 키가 없어요" 로 멈춘다. 그때는 사용자에게 키를 받으라고 알리고 멈춘다.
|
||||
- (선택) Claude Code 에서 GA 를 직접 묻고 싶으면 `claude mcp add analytics-mcp --scope user -e GOOGLE_APPLICATION_CREDENTIALS=<저장소 원본 폴더>/secrets/ga-key.json -e GOOGLE_CLOUD_PROJECT=nalssigak -- uvx analytics-mcp` 후 Claude Code 를 다시 시작한다.
|
||||
|
||||
## 1. GA4 받기
|
||||
|
||||
```
|
||||
uvx --from analytics-mcp python .claude/skills/ga-report/ga_pull.py <일수> > /tmp/ga_report.json
|
||||
```
|
||||
|
||||
- 키는 스크립트가 저장소 원본 폴더의 `secrets/ga-key.json` 에서 찾는다(워크트리에서 불러도 같음).
|
||||
- 속성 `558046406`(날씨각 웹, 계정 AIO2O). 서비스 계정 `nalssigak-ga@nalssigak.iam.gserviceaccount.com`, 권한은 GA 뷰어뿐. 키 파일 내용은 열거나 옮기지 않는다.
|
||||
- 결과 JSON: 값마다 `[이번, 앞 기간]`. `totals`·`daily`·`platform`·`host`·`channels`·`sources`·`landing`·`pages`·`devices`·`new_vs_returning`·`cities`·`events`·`gak_views`·`region_changes`, 퍼널 4개(`funnel_saju`·`funnel_game`·`funnel_install`·`funnel_login`, 이번 기간만), `cohorts`(첫 방문 주별 재방문).
|
||||
- `errors` 가 비어 있지 않으면 그 항목은 못 받은 것이다. 보고에 적고 넘어간다.
|
||||
- 더 파고들 게 있으면 `analytics-mcp` MCP 도구(`run_report`·`run_funnel_report`·`run_realtime_report`)를 쓴다. 이 세션에 도구가 없으면 같은 키로 `google.analytics.data_v1beta` 를 직접 부른다.
|
||||
- 이벤트 뜻은 저장소 `docs/이벤트_추적.md` 이벤트 목록을 기준으로 읽는다.
|
||||
|
||||
## 2. 운영 DB 숫자 (읽기만, 집계만)
|
||||
|
||||
GA 는 로그인·레벨·사주 저장을 모른다. 같은 기간을 운영 DB 에서 센다. 개인 값(닉네임·아이디·생년월일)은 뽑지 않는다.
|
||||
|
||||
```
|
||||
ssh King_admin 'docker exec -i o2o-weather-postgres-1 sh -c "psql -U \$POSTGRES_USER -d \$POSTGRES_DB"' <<'SQL'
|
||||
\set s '<시작 YYYY-MM-DD>'
|
||||
\set e '<끝 YYYY-MM-DD>'
|
||||
SELECT provider, count(*) AS signups FROM users WHERE NOT deleted AND (created_at AT TIME ZONE 'Asia/Seoul')::date BETWEEN :'s' AND :'e' GROUP BY provider ORDER BY provider;
|
||||
SELECT action, count(*) AS n, count(DISTINCT user_id) AS users FROM point_log WHERE day BETWEEN :'s' AND :'e' AND action <> 'admin' GROUP BY action ORDER BY n DESC;
|
||||
SELECT count(DISTINCT user_id) AS active_earners FROM point_log WHERE day BETWEEN :'s' AND :'e' AND action <> 'admin';
|
||||
SELECT lv, count(*) FROM (SELECT CASE WHEN p >= 1000 THEN 7 WHEN p >= 700 THEN 6 WHEN p >= 400 THEN 5 WHEN p >= 200 THEN 4 WHEN p >= 100 THEN 3 WHEN p >= 30 THEN 2 ELSE 1 END AS lv
|
||||
FROM (SELECT u.user_id, COALESCE(sum(l.points) FILTER (WHERE l.action <> 'admin'), 0) AS p FROM users u LEFT JOIN point_log l USING (user_id) WHERE NOT u.deleted GROUP BY u.user_id) t) x GROUP BY lv ORDER BY lv;
|
||||
SELECT count(*) FILTER (WHERE birth_date IS NOT NULL) AS birth_saved, count(*) AS users FROM users WHERE NOT deleted;
|
||||
SQL
|
||||
```
|
||||
|
||||
- provider: 1 아이디, 2 구글, 3 토스. 앞 기간도 같은 쿼리로 센다.
|
||||
- `point_log` 의 `action='admin'` 은 관리자가 레벨을 올려 준 것이라 늘 뺀다. 레벨 경계는 `backend/services/level_service.py` `LEVELS` 를 따른다(바뀌었으면 쿼리도 맞춘다).
|
||||
|
||||
## 3. 그 기간에 바뀐 것
|
||||
|
||||
`git log origin/main --first-parent --since=<시작> --until=<끝+1일> --format='%ad %s' --date=short` 로 배포된 변화를 뽑는다. 숫자 변화와 날짜가 겹치는 변화를 후보 원인으로만 적는다.
|
||||
|
||||
## 4. 읽는 규칙
|
||||
|
||||
- **결론부터, 판단으로.** 숫자를 늘어놓지 말고 "무엇이 좋아졌고 나빠졌는지 → 왜 그렇게 보는지(근거 숫자) → 그래서 할 일" 순서로 쓴다. 전제에서 결론까지 고리를 빠짐없이 적는다.
|
||||
- **작은 수는 사람 수로.** 한 칸이 30명 미만이면 비율(전환율·참여율)로 말하지 않고 "12명 중 3명"처럼 적는다. 앞 기간이 10명 미만이면 증감 %를 쓰지 않는다.
|
||||
- **우리 팀 트래픽을 가린다.** 회사가 성남(분당)이라 `cities` 의 Seongnam-si, `region_changes` 에서 소수가 수십 번 바꾼 지역(예: 분당구 108번·7명)은 팀 테스트일 가능성이 크다. 그 몫을 빼고 봤을 때도 결론이 같은지 함께 적는다. 추정이면 "추정"이라고 표시한다.
|
||||
- **한 기간 변화로 원인을 단정하지 않는다.** 배포·홍보(인스타·검색)와 날짜가 겹치면 "후보"로 두고, 2기간 이상 같은 방향일 때만 원인이라고 쓴다.
|
||||
- **퍼널은 개발 서버 이벤트가 섞여 있다**(퍼널 API 에 호스트 거름을 안 걸었다). 큰 그림만 보고, 단계 사이 사람 수가 1~2명이면 판단하지 않는다.
|
||||
- **못 보는 것은 못 본다고 쓴다.** 지금 GA 맞춤 측정기준은 `gak_name`·`platform`·`region_name` 셋뿐이라, `today_icon` 의 `icon`·`sheet_open` 의 `sheet`·`saju_view` 의 `score` 같은 값별 나눔은 GA 에서 안 나온다. 필요하면 "GA4 관리 → 맞춤 정의에 ○○ 등록"을 할 일로 낸다(등록 전 데이터는 소급 안 됨).
|
||||
- `platform` 이 `(not set)` 인 몫은 그 값이 붙기 전 이벤트(자동 수집 `page_view`·`session_start` 등)다. 웹·토스 비교는 `host`(weather.o2o.kr vs nalssigak.apps.tossmini.com)로 본다.
|
||||
|
||||
## 5. 기록
|
||||
|
||||
- 저장소 `docs/이벤트_추적.md` 맨 아래 `## 분석 기록` 표(없으면 만든다: 날짜 · 기간 · 활성 사용자(앞 기간) · 신규 · 가입(DB) · 바뀐 것 · 할 일)에 한 줄 더한다.
|
||||
- 결정이 필요한 것(맞춤 측정기준 등록, 내부 트래픽 필터, 기능 손보기)은 `TODO.md` 에 `[결정 필요]` 행으로 적는다.
|
||||
- main 에 바로 커밋하지 않는다. 작업 브랜치에서 커밋해 main 에 합친다. 커밋은 `docs: <날짜> GA 분석 — <한 줄>`.
|
||||
- 코드·문구는 고치지 않는다. 제안만 한다.
|
||||
|
||||
## 6. 보고 (채팅, 짧게)
|
||||
|
||||
1. **결론 3줄 이내**: 이번 기간 핵심 변화와 그 판단.
|
||||
2. **바뀐 것 (앞 기간 대비)**: 사용자·신규·재방문, 유입 경로, 기능별 사용(사주·게임·오늘 한 장·쇼츠·단풍·동네 이야기·각 상세), 가입·레벨(DB). 기능마다 한 줄, 사람 수로.
|
||||
3. **다음 할 일 1~3개**: 무엇을 · 왜(근거 숫자) · 기대 효과. 측정이 안 돼서 판단 못 한 건 "측정 먼저"로 낸다.
|
||||
4. 못 받은 항목(`errors`)·못 보는 것이 있으면 한 줄.
|
||||
@@ -0,0 +1,143 @@
|
||||
"""날씨각 GA4 숫자를 한 번에 받아 JSON 으로 낸다. 이번 기간과 바로 앞 같은 길이 기간을 함께 받는다.
|
||||
|
||||
실행: uvx --from analytics-mcp python .claude/skills/ga-report/ga_pull.py [일수]
|
||||
키는 저장소 원본 폴더의 secrets/ga-key.json (워크트리에서 불러도 원본 폴더 것을 쓴다). GOOGLE_APPLICATION_CREDENTIALS 가 있으면 그걸 쓴다.
|
||||
개발 서버(localhost 등)에서 나간 이벤트는 모두 뺀다.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from datetime import date, timedelta
|
||||
|
||||
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS"):
|
||||
common = subprocess.run(["git", "rev-parse", "--path-format=absolute", "--git-common-dir"], cwd=os.path.dirname(os.path.abspath(__file__)),
|
||||
capture_output=True, text=True, check=True).stdout.strip()
|
||||
key = os.path.join(os.path.dirname(common), "secrets", "ga-key.json")
|
||||
if not os.path.exists(key):
|
||||
sys.exit(f"GA 키가 없어요: {key} (팀에서 받은 키 파일을 이 이름으로 두세요)")
|
||||
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = key
|
||||
|
||||
from google.analytics.data_v1alpha import AlphaAnalyticsDataClient
|
||||
from google.analytics.data_v1alpha import types as A
|
||||
from google.analytics.data_v1beta import BetaAnalyticsDataClient
|
||||
from google.analytics.data_v1beta.types import (
|
||||
CohortSpec, Cohort, CohortsRange, DateRange, Dimension, Filter, FilterExpression, FilterExpressionList, Metric, OrderBy, RunReportRequest,
|
||||
)
|
||||
|
||||
PROPERTY = "properties/558046406"
|
||||
DAYS = int(sys.argv[1]) if len(sys.argv) > 1 else 7
|
||||
END = date.today() - timedelta(days=1) # 오늘은 하루가 안 끝나 빼고 어제까지
|
||||
CUR = (END - timedelta(days=DAYS - 1), END)
|
||||
PREV = (CUR[0] - timedelta(days=DAYS), CUR[0] - timedelta(days=1))
|
||||
DEV_HOSTS = ["localhost", "127.0.0.1", "192.168."]
|
||||
|
||||
beta = BetaAnalyticsDataClient()
|
||||
alpha = AlphaAnalyticsDataClient()
|
||||
out: dict = {"days": DAYS, "cur": [str(CUR[0]), str(CUR[1])], "prev": [str(PREV[0]), str(PREV[1])], "errors": []}
|
||||
|
||||
|
||||
def not_dev() -> FilterExpression:
|
||||
return FilterExpression(not_expression=FilterExpression(or_group=FilterExpressionList(expressions=[
|
||||
FilterExpression(filter=Filter(field_name="hostName", string_filter=Filter.StringFilter(match_type=Filter.StringFilter.MatchType.CONTAINS, value=h)))
|
||||
for h in DEV_HOSTS
|
||||
])))
|
||||
|
||||
|
||||
def event_is(name: str) -> FilterExpression:
|
||||
return FilterExpression(filter=Filter(field_name="eventName", string_filter=Filter.StringFilter(value=name)))
|
||||
|
||||
|
||||
def both(a: FilterExpression, b: FilterExpression) -> FilterExpression:
|
||||
return FilterExpression(and_group=FilterExpressionList(expressions=[a, b]))
|
||||
|
||||
|
||||
def report(key: str, dims: list[str], metrics: list[str], limit: int = 30, compare: bool = True, where: FilterExpression | None = None) -> None:
|
||||
"""이번·앞 기간 표. 행마다 {dims..., metric: [이번, 앞]}"""
|
||||
ranges = [DateRange(start_date=str(CUR[0]), end_date=str(CUR[1]), name="cur")]
|
||||
if compare:
|
||||
ranges.append(DateRange(start_date=str(PREV[0]), end_date=str(PREV[1]), name="prev"))
|
||||
try:
|
||||
r = beta.run_report(RunReportRequest(
|
||||
property=PROPERTY, date_ranges=ranges, dimensions=[Dimension(name=d) for d in dims], metrics=[Metric(name=m) for m in metrics],
|
||||
dimension_filter=both(not_dev(), where) if where else not_dev(), limit=limit * 2,
|
||||
order_bys=[OrderBy(metric=OrderBy.MetricOrderBy(metric_name=metrics[0]), desc=True)],
|
||||
))
|
||||
except Exception as e:
|
||||
out["errors"].append(f"{key}: {e}")
|
||||
return
|
||||
rows: dict[tuple, dict] = {}
|
||||
for row in r.rows:
|
||||
vals = [v.value for v in row.dimension_values]
|
||||
rng = vals[-1] if compare else "cur"
|
||||
k = tuple(vals[:len(dims)])
|
||||
item = rows.setdefault(k, {**dict(zip(dims, k)), **{m: [0, 0] for m in metrics}})
|
||||
for m, v in zip(metrics, row.metric_values):
|
||||
item[m][0 if rng == "cur" else 1] = round(float(v.value), 3)
|
||||
out[key] = sorted(rows.values(), key=lambda x: -x[metrics[0]][0])[:limit]
|
||||
|
||||
|
||||
def funnel(key: str, steps: list[tuple[str, str, str | None]]) -> None:
|
||||
"""(단계 이름, 이벤트, page_location 에 들어갈 글자) 순서대로. 이번 기간만"""
|
||||
def step(name: str, event: str, path: str | None) -> A.FunnelStep:
|
||||
f = A.FunnelEventFilter(event_name=event)
|
||||
if path:
|
||||
f.funnel_parameter_filter_expression = A.FunnelParameterFilterExpression(funnel_parameter_filter=A.FunnelParameterFilter(
|
||||
event_parameter_name="page_location", string_filter=A.StringFilter(match_type=A.StringFilter.MatchType.CONTAINS, value=path)))
|
||||
return A.FunnelStep(name=name, filter_expression=A.FunnelFilterExpression(funnel_event_filter=f))
|
||||
try:
|
||||
r = alpha.run_funnel_report(A.RunFunnelReportRequest(
|
||||
property=PROPERTY, date_ranges=[A.DateRange(start_date=str(CUR[0]), end_date=str(CUR[1]))],
|
||||
funnel=A.Funnel(steps=[step(*s) for s in steps]),
|
||||
))
|
||||
except Exception as e:
|
||||
out["errors"].append(f"{key}: {e}")
|
||||
return
|
||||
table = r.funnel_table
|
||||
heads = [h.name for h in table.metric_headers]
|
||||
out[key] = [{"step": row.dimension_values[0].value, **{h: round(float(v.value), 3) for h, v in zip(heads, row.metric_values)}} for row in table.rows]
|
||||
|
||||
|
||||
def cohorts() -> None:
|
||||
"""첫 방문 주별 4개 묶음이 그다음 주들에 몇 명 다시 왔는지"""
|
||||
monday = END - timedelta(days=END.weekday())
|
||||
groups = [Cohort(name=f"week_{i}", dimension="firstSessionDate", date_range=DateRange(
|
||||
start_date=str(monday - timedelta(weeks=i)), end_date=str(monday - timedelta(weeks=i) + timedelta(days=6)))) for i in range(4, 0, -1)]
|
||||
try:
|
||||
r = beta.run_report(RunReportRequest(
|
||||
property=PROPERTY, dimensions=[Dimension(name="cohort"), Dimension(name="cohortNthWeek")], metrics=[Metric(name="cohortActiveUsers")],
|
||||
cohort_spec=CohortSpec(cohorts=groups, cohorts_range=CohortsRange(granularity=CohortsRange.Granularity.WEEKLY, end_offset=3)),
|
||||
))
|
||||
except Exception as e:
|
||||
out["errors"].append(f"cohorts: {e}")
|
||||
return
|
||||
table: dict[str, dict] = {}
|
||||
for g in groups:
|
||||
table[g.name] = {"first_week": g.date_range.start_date}
|
||||
for row in r.rows:
|
||||
c, n = row.dimension_values[0].value, int(row.dimension_values[1].value)
|
||||
table[c][f"week+{n}"] = int(row.metric_values[0].value)
|
||||
out["cohorts"] = list(table.values())
|
||||
|
||||
|
||||
report("totals", [], ["activeUsers", "newUsers", "sessions", "engagedSessions", "engagementRate", "averageSessionDuration", "screenPageViews", "eventCount"])
|
||||
report("daily", ["date"], ["activeUsers", "newUsers", "sessions"], limit=DAYS, compare=False)
|
||||
report("platform", ["customEvent:platform"], ["activeUsers", "sessions", "eventCount"])
|
||||
report("host", ["hostName"], ["activeUsers", "sessions"], limit=10)
|
||||
report("channels", ["sessionDefaultChannelGroup"], ["sessions", "activeUsers", "engagementRate"])
|
||||
report("sources", ["sessionSource", "sessionMedium"], ["sessions", "activeUsers", "engagementRate"], limit=15)
|
||||
report("landing", ["landingPage"], ["sessions", "engagementRate", "averageSessionDuration"], limit=20)
|
||||
report("pages", ["pagePath"], ["screenPageViews", "activeUsers", "userEngagementDuration"], limit=25)
|
||||
report("devices", ["deviceCategory", "operatingSystem"], ["activeUsers", "sessions", "engagementRate"], limit=10)
|
||||
report("new_vs_returning", ["newVsReturning"], ["activeUsers", "sessions", "engagementRate"])
|
||||
report("cities", ["city"], ["activeUsers"], limit=15)
|
||||
report("events", ["eventName"], ["eventCount", "totalUsers"], limit=60)
|
||||
report("gak_views", ["customEvent:gak_name"], ["eventCount", "totalUsers"], limit=15, where=event_is("view_gak"))
|
||||
report("region_changes", ["customEvent:region_name"], ["eventCount", "totalUsers"], limit=15, where=event_is("region_change"))
|
||||
funnel("funnel_saju", [("사주 페이지", "page_view", "/saju"), ("생년월일 넣음", "saju_input", None), ("결과 봄", "saju_view", None)])
|
||||
funnel("funnel_game", [("게임 페이지", "page_view", "/game"), ("첫 판 시작", "game_start", None), ("라운드 깸", "game_round", None), ("끝까지 함", "game_over", None)])
|
||||
funnel("funnel_install", [("설치 카드 봄", "install_banner_view", None), ("설치 누름", "install_click", None), ("설치 완료", "install_done", None)])
|
||||
funnel("funnel_login", [("첫 방문", "first_visit", None), ("창 열기", "sheet_open", None), ("로그인", "login", None)])
|
||||
cohorts()
|
||||
|
||||
print(json.dumps(out, ensure_ascii=False, indent=1))
|
||||
@@ -27,6 +27,12 @@ backend/uploads/
|
||||
.impeccable/
|
||||
|
||||
/zzz
|
||||
|
||||
# 안드로이드 스튜디오 개인 설정
|
||||
.idea/
|
||||
|
||||
# 루트에 생기는 안드로이드 디버그 빌드 산출물 (소스 없음)
|
||||
/app/build/
|
||||
# 인증서·키: 서버와 각자 PC 에만 둔다 (토스 mTLS 등)
|
||||
secrets/
|
||||
*.pem
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# 날씨각 저장소 규칙
|
||||
|
||||
## GA4 이벤트 (모든 기능)
|
||||
|
||||
- 새 기능(페이지·게임·창·버튼 흐름)을 만들거나 바꾸면 같은 작업 안에서 GA4 이벤트를 넣는다. 따로 시키지 않아도 넣는다.
|
||||
1. `frontend/src/lib/analytics.ts` `Events` 타입에 이벤트와 값 추가
|
||||
2. 화면에서 `track(이벤트, 값)` 호출 — 시작·핵심 행동·끝이 잡히게
|
||||
3. `docs/이벤트_추적.md` 이벤트 목록 표에 행 추가
|
||||
- 완료 보고의 검증 결과에 넣은 이벤트 이름을 적는다. GA 없이 "완료"라고 하지 않는다.
|
||||
- 값에 개인정보(아이디·닉네임·생년월일 등)를 넣지 않는다.
|
||||
@@ -18,14 +18,17 @@ Claude Code에서 한 줄:
|
||||
/daily-ootd minimal ← 오늘의 코디 4장
|
||||
```
|
||||
|
||||
만들고 검수하고 날씨각 피드·인스타까지 올린 뒤 링크를 보고한다. 자세한 건 [docs/인스타_카드_사용법.md](docs/인스타_카드_사용법.md).
|
||||
만들고 검수하고 날씨각 피드·인스타까지 올린 뒤 링크를 보고한다. 자세한 건 [docs/인스타_운영.md](docs/인스타_운영.md) 1장.
|
||||
|
||||
사람이 나오는 영상·카드뉴스는 [`admin/nalssigak/models/`](admin/nalssigak/models/)의 날씨각 가상 모델을 쓴다. 나이대·생김새는 `models.json`, 얼굴을 만든 프롬프트는 `prompts/`에 있다.
|
||||
|
||||
## 주요 문서
|
||||
|
||||
- [서비스 동작 안내](docs/서비스_동작_안내.md) — 날씨를 언제 받고 점수를 어떻게 매기나
|
||||
- [각 계산 기준](docs/각_계산기준.md) · [점수 계산식](docs/점수_계산식.md)
|
||||
- [피드 동작 방식](docs/피드_동작방식.md) · [콘텐츠 설계서](docs/콘텐츠_설계서.md)
|
||||
- [인스타 카드 사용법](docs/인스타_카드_사용법.md)
|
||||
- [서비스 동작 안내](docs/서비스_동작_안내.md) — 날씨를 언제 받고 피드를 어떻게 만드나, 화면별 데이터, 토스판
|
||||
- [점수 계산식](docs/점수_계산식.md) · [각 계산 기준](backend/docs/각_계산기준.md)
|
||||
- [검색 노출](docs/검색_노출.md) — 지역 페이지 구조, 구글 정책, 매일 순위 기록
|
||||
- [인스타 운영](docs/인스타_운영.md) — 카드 올리는 법, 홍보 기획
|
||||
- [이벤트 추적](docs/이벤트_추적.md) (GA4) · [QA 체크리스트](docs/QA_체크리스트.md)
|
||||
- [TODO](TODO.md) — 결정 필요·미해결 항목
|
||||
- 회의록: `docs/meetings/`
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
| [ ] | 날씨 타로·오늘 날씨 코디 기획 (옷차림 [보류] 행과 합침). 타로는 운세 주제별 귀여운 각 이름으로 — 예: 애정 날씨 타로 → '다툼구름각' (사용자 10/21) | 10/20 회의 | |
|
||||
| [ ] | **[결정 필요]** 피드 각 카드에서 빨래각 같은 평이한 각 빼기 — 피드 각 3개는 전체 순위로 골라 빨래각(priority 1)이 들어감. priority를 낮추면 히어로·각 탭 순위도 바뀜. priority 조정 vs 피드에선 is_fun 각 먼저 | 피드 순서 작업 중 발견 | `backend/seed/index_definition.json`, `backend/services/feed_service.py` |
|
||||
| [ ] | 오늘의 각 카드 순위와 점수 순서가 다름(1위 83점, 2위 97점) — 순위에 중요도를 섞어서. 카드로 보이니 어색함 | 카드화 중 발견 | `backend/services/index_service.py` |
|
||||
| [ ] | AdSense 게재 — 피드 포스트 사이 인피드 광고(포스트 틀, '광고' 표시, 몇 개마다 넣을지 결정). 게시자 ID(ca-pub-…) 받은 뒤 진행, `public/ads.txt`·`privacy.html` 광고 쿠키 고지·`docs/콘텐츠_설계서.md:11` '광고 없음' 수정 같이 | 사용자 결정 10/21, ID 없음 (https://adsense.google.com/start/) | `frontend/index.html`, `frontend/src/b/TodayPage.tsx` |
|
||||
| [ ] | AdSense 게재 — 피드 포스트 사이 인피드 광고(포스트 틀, '광고' 표시, 몇 개마다 넣을지 결정). 게시자 ID(ca-pub-…) 받은 뒤 진행, `public/ads.txt`·`privacy.html` 광고 쿠키 고지 같이 | 사용자 결정 10/21, ID 없음 (https://adsense.google.com/start/) | `frontend/index.html`, `frontend/src/b/TodayPage.tsx` |
|
||||
| [ ] | 테스트 실패 2건: `test_feed.py::test_feed_assembles_hero_stories_posts_and_bands`(각 57개, 기대 40 — 커밋 전 각 추가 영향), `test_weather_today.py:60`(날짜 따라 18시 아이콘 moon) | 피드 순서 작업 중 발견 | `backend/tests/` |
|
||||
|
||||
## 10/21 회의 (`docs/meetings/2026-10-21.md`)
|
||||
@@ -99,6 +99,8 @@
|
||||
| [ ] | 날씨 사주 해석 기준 — 사용자가 맡김(10/28 "니 알아서 하라"), 바꿀 수 있게 기록: 날씨 접목은 조후(한난조습) · 연애운은 열 때 성별 선택 입력(남/여/선택 안 함, 안 하면 도화·배우자궁만으로 본다고 표시) · 도화는 연지·일지 삼합 둘 다 · 홍염은 일간표(甲乙午 丙寅 丁未 戊己辰 庚戌 辛酉 壬子 癸申, 이견 있음 표시) · 합충형파해원진은 원국 네 지지 모두, 일지에 걸리면 연애 가중 · 절입 시각은 천문 계산식으로 1900~2100 표를 만들고 천문연 값으로 검증(패키지 안 씀) · 진태양시(출생지 경도)·서머타임 반영, 자시는 자정 기준(설정으로 변경) · 음력은 다음 단계(천문연 API) | 사용자 위임 10/28 | |
|
||||
| [ ] | **[결정 필요]** 날씨 사주 화면·문구 — '내 기운'(계절·날씨 장면 16종), 점수 → 사주 풀이 → 계절·날씨 한 스푼, 하루 풀이를 '오늘의 결정 카드'(언제·미룰 것·입을 것/갈 곳·이번 주 날짜)로 줄지, 규칙별 의미 사전·문구 검토, 기운 장면 그림 | 사용자 피드백 10/28 | 기획서 '날씨 사주 기획 v2', '계정 레벨·날씨 사주 UI 기획' |
|
||||
| [ ] | **[결정 필요]** 날씨 사주 Codex 검수(10/28) 중 반영 안 한 것: ① 금전·일 날짜 추천("큰돈 쓰거나 계약할 일은 10/31(토)") — Codex는 운세로 계약·면접 날짜를 정해 주지 말고 점검 행동만 주라고 했으나, 사주 앱 장르상 날짜가 핵심이라 유지하고 그날 점수 60 이상일 때만 고르게 함 ② 점수를 '참고 점수'로 부를지 ③ 결과 위에 출생 정보 요약·칸 이동 메뉴, 사주 글자 표 접기 ④ 11월부터 올해 운 자리에 내년 미리 보기 — 올해·내년을 따로 고르게 할지 ⑤ 연애운 성별 기준(남 재성·여 관성)을 '전통 기준'이라고 더 밝힐지 | Codex 검수 `/tmp/sweep/codex-review.md` | `backend/services/saju_service.py`, `frontend/src/b/SajuPage.tsx` |
|
||||
| [x] | 사주 보정(10/29 사용자 지적: 토 많은 未월생이 '장맛비 기운'으로 나옴) — 월령 바탕값, 흙은 계절 따라 조습, 未 0.9, 오행 세력(지장간 날 수·월지 30·일지 20·그 외 10)·신강신약, 균형 축 이름은 세력 1위 오행 쪽 | 『궁통보감』 三夏己土, 계산식 `docs/사주_계산식.md` | `backend/services/saju/climate.py`, `strength.py` |
|
||||
| [ ] | **[결정 필요]** 사주 명식 C안(요약 먼저형) 문구 확인 — 10/29 사용자 C안 선택, 구현은 `fix/saju-climate`(제목 '사주 명식', '흙(土) 기운이 가장 센 신강 사주', 오행 막대, 십성·'나'·월령 표시, 용어 풀이 10개). 문구 확인 뒤 병합 | 시안 v5, 사용자 선택 10/29 | `frontend/src/b/SajuPage.tsx` `MeCard`, `backend/router/v1/saju/saju.py` |
|
||||
|
||||
## 진행 순서
|
||||
|
||||
@@ -169,7 +171,7 @@
|
||||
| [x] | 계절 이야기 사진 연결 — 받은 13장(`frontend/public/season/`)을 `article`에 사진 칸 추가해 띠·목록·상세·피드에 표시, CC BY 계열은 저작자·라이선스 표시. 스켈레톤 작업 끝난 뒤 진행 | 사용자 요청 | `backend/common/database/model/models.py`, `backend/seed/article.json`, `frontend/src/b/SeasonPage.tsx`, `frontend/src/b/Sheets.tsx`, `frontend/src/b/TodayPage.tsx` |
|
||||
| [ ] | **[결정 필요]** 계절 이야기 사진 2장 안 씀 — `di.jpg`(매미)는 불쾌지수 글과 주제가 다르고, `peanut_new.jpg`(일본 가토리시 삶은 땅콩, 왼쪽은 일본 대립종)는 '국산 햇땅콩' 글과 맞지 않아 아이콘 유지. 맞는 사진을 새로 구할지 | 계절 이야기 사진 연결 중 판단 | `frontend/public/season/sources.json`, `backend/seed/article.json` |
|
||||
| [x] | (로컬 반영함, 운영 DB는 배포 때 같은 ALTER 필요) 로컬 DB 칼럼 추가 후 백엔드·워커 컨테이너 다시 빌드 — 지금 9810 백엔드는 이미지로 떠 있어 이번 백엔드 수정이 화면에 안 보임. 필요한 ALTER: `weather_daily.rain_prob_am`/`rain_prob_pm SMALLINT NULL`, `index_score.estimated BOOLEAN NOT NULL DEFAULT false`. 진행 중인 백엔드 작업이 끝난 뒤 실행 | 오늘/내일/토/일 작업 중 발견 | `backend/postgres-init/init.sql`, `compose.yaml` |
|
||||
| [ ] | **[결정 필요]** 확정 시안(`docs/시안_B_확정.html` 489·585행, `.trend3`)에 각 점수 칸이 아직 "오늘·내일·모레" 3칸 — 실제는 오늘/내일/토/일 4칸. 시안도 고칠지 | 오늘/내일/토/일 작업 중 발견 | `docs/시안_B_확정.html` |
|
||||
| [x] | 확정 시안(시안 B)에 각 점수 칸이 아직 "오늘·내일·모레" 3칸 — 실제는 오늘/내일/토/일 4칸. 시안 파일을 지워(10/29 docs 정리) 해당 없음 | 오늘/내일/토/일 작업 중 발견 | |
|
||||
| [x] | (로컬 반영함, 운영은 배포 때) 행사 아이콘 `calendar`→`fireworks` 기존 DB 반영 — 코드·`init.sql` 기본값만 바뀌어 이미 들어간 행사는 그대로. 필요한 명령: `UPDATE event SET icon='fireworks' WHERE icon='calendar'; ALTER TABLE event ALTER COLUMN icon SET DEFAULT 'fireworks';` (운영은 확인 받고) | 아이콘 오용 수정 중 발견 | `backend/postgres-init/init.sql`, `backend/common/database/model/models.py` |
|
||||
| [x] | (로컬 반영함) seed 다시 넣기 — 밤 문장 아이콘 `moon`, 한 문장 8개의 내부 메모 출처 줄 삭제가 DB에 반영되도록 `docker exec o2o-weather-backend-1 python scripts/load_seed.py` | 뜻 모를 표시 수정 | `backend/seed/article.json` |
|
||||
| [ ] | 한 문장 8개(`quote-clear-2·3`, `quote-cloud-1·2`, `quote-rain-1·2`, `quote-any-1`, `quote-night-3`) 문구 검수 — 직접 쓴 예시 문장이라 출처 없이 나감 | 출처 줄 '날씨각 (검수 전 예시)' 삭제하며 메모 옮김 | `backend/seed/article.json` |
|
||||
@@ -177,7 +179,7 @@
|
||||
| [ ] | 마스크 아이콘 없음 — 미세먼지 포스트가 좋음·보통은 `vent`, 나쁨 이상은 `cloud`를 씀 | 미세먼지 포스트 작업 중 발견 | `frontend/public/icons/`, `backend/services/feed_service.py` (`_air`) |
|
||||
| [x] | 주말 화면 '데이트 명소'는 아직 시도 기준(`places`) — 행사처럼 거리 기준으로 바꿀지. 지금 명소 데이터는 10곳뿐 | 행사 거리 기준 작업 중 발견 | `backend/services/week_service.py` (`places`), `frontend/src/b/WeekPage.tsx` |
|
||||
| [ ] | 행사 수집이 사용자 한 명당 주변 시도 2~4곳으로 늘어 TourAPI·문화정보 API 호출이 시도 수만큼 늘어남(시도별 하루 1회 캐시) — 운영 배포 때 일일 호출 한도 확인 | 행사 거리 기준 작업 중 발견 | `backend/services/week_service.py` (`_ensure_events`), `backend/docs/load-estimate.md` |
|
||||
| [ ] | 다른 문서의 포스트 종류 목록·행사 시도 기준 설명 갱신 (`PostType` 12 미세먼지, 30km 행사) — `docs/포스트_종류별_내용.html`만 고침 | 문서 점검 | `backend/docs/`, `docs/화면별_데이터_출처.html`, `docs/데이터_흐름.html`, `docs/콘텐츠_설계서.md` |
|
||||
| [ ] | 다른 문서의 포스트 종류 목록·행사 시도 기준 설명 갱신 (`PostType` 12 미세먼지, 30km 행사) — 포스트 종류별 내용(지금 `docs/서비스_동작_안내.md` 5장)만 고침 | 문서 점검 | `backend/docs/`, `docs/서비스_동작_안내.md` 1·2장 |
|
||||
| [ ] | **[결정 필요]** 스켈레톤 작업에서 바뀐 디자인 — 댓글 없음 안내가 글자 두 줄 → 상자(스켈레톤 3줄 크기) | 스켈레톤 작업 중 발견 | `frontend/src/b/Sheets.tsx` (`CommentsSheet`) |
|
||||
| [x] | **[결정 필요]** 히어로 시안 A/B/C 중 선택 — 지금은 이전 히어로로 롤백 → 10/12 D4-2로 결정(해 안 점수 + 문장 두 줄은 서버 값 그대로 + 상태 한 줄 + 하루 흐름 칸, 높이는 지금 그대로 약 400px) | 히어로 다듬기 | `frontend/src/b/TodayPage.tsx`, `frontend/src/b/b.css` |
|
||||
| [x] | **[결정 필요]** 히어로 D4-2 상태 한 줄 — ① 습도는 서버가 %만 줘서 단계 기준을 새로 정해야 함 ② 불쾌지수 '불쾌'처럼 판정 이름을 그대로 쓸지 ③ 미세먼지·자외선은 늘 보일지, 조심할 때만 보일지 → 10/12 결정: 습도 건조(30% 미만)·보통(60% 이하)·습함, 불쾌지수 단계 이름 그대로, 늘 4개(밤엔 자외선 빼기) | 히어로 D4-2 시안 | `backend/services/hero_stats.py`, `backend/services/feed_service.py`, `frontend/src/b/TodayPage.tsx` |
|
||||
@@ -206,11 +208,11 @@
|
||||
| [x] | 검색 노출 1단계: 메타는 `index.html` 하나로 유지 + canonical, `robots.txt`·`sitemap.xml`(메인 한 줄) 추가 — 탭별 HTML로 나누는 안은 효과(탭별 공유 미리보기·탭별 색인)가 작아 보류. 도메인 `weather.o2o.kr` 고정이라 바뀌면 두 파일도 수정 | 10/8 논의 | `frontend/index.html`, `frontend/public/robots.txt`, `frontend/public/sitemap.xml` |
|
||||
| [ ] | **[보류]** AEO·일반 검색어 유입 — 본문이 HTML에 없어 네이버 Yeti·AI 크롤러(GPTBot 등)는 메타만 읽고, 일반 검색어("세차하기 좋은 날씨" 등)는 메타만으로 순위에 못 듦. 지금 탭 내용은 지역별·매일 바뀌는 값이라 색인돼도 금방 틀림. 하려면 검색어용 페이지(각 기준·월별 노을 시간·노을 명소·계절 글·월별 행사)를 새로 만들어야 함 → 기획 결정 필요. 계절 이야기 글은 지역 무관이라 글마다 주소만 붙이면 바로 후보 | 10/8 논의 | [검색 유입 기획](https://claude.ai/artifact/SKz9SipYyguERGF8weUpZs), [검색어 리서치](https://claude.ai/artifact/Eu5ax3DbR9SdnhKdMRzE3p) |
|
||||
| [ ] | 구로 나뉜 13개 시의 구마다 자기 주소(`/today/gyeonggi/seongnam/bundang`, 39장) — 운영 반영(`96cbd19`, 10/20). 남은 것: 서치 콘솔·서치어드바이저에 sitemap 다시 제출 | 구글 '분당구 오늘 날씨' 상위는 모두 구 단위 페이지, 우리는 성남시 한 장에 묶여 분당구 주소가 없었음 | `backend/scripts/gen_region_pages.py`, `frontend/vite.config.ts`, `frontend/nginx.conf`, `backend/router/v1/seo/seo.py` |
|
||||
| [ ] | **[보류]** 날씨별 옷차림 콘텐츠 — 후보: ① `/outfit` 기온별 옷차림 고정 페이지 ② 지역 페이지·오늘 탭에 '오늘 옷차림' 한 줄. 형태 미정 | 구글 트렌드 '옷차림'≈'노을'(세차의 0.8배), 네이버 자동완성 '기온별 옷차림'·'20도 옷차림'·'서울 오늘 날씨 옷차림'. 지금은 주말 탭·히어로의 '겉옷' 팁뿐 | `docs/검색어_인기_리서치.md`, `backend/services/weekend_plan.py` |
|
||||
| [ ] | 서치 콘솔: 홈 URL 검사(구조화 데이터 '날씨각' 인식 확인)·재크롤링 요청, 색인 생성 보고서에서 지역 페이지 몇 장 색인됐는지 확인 / 네이버 서치어드바이저: 주요 지역 페이지 수집 요청(네이버 색인 10/235) | 사이트 이름 '에이아이오투오' 표시, 지역 페이지 색인 부족 | `docs/구글_검색_정책_리서치.md` |
|
||||
| [ ] | **[보류]** 날씨별 옷차림 콘텐츠 — 후보: ① `/outfit` 기온별 옷차림 고정 페이지 ② 지역 페이지·오늘 탭에 '오늘 옷차림' 한 줄. 형태 미정 | 구글 트렌드 '옷차림'≈'노을'(세차의 0.8배), 네이버 자동완성 '기온별 옷차림'·'20도 옷차림'·'서울 오늘 날씨 옷차림'. 지금은 주말 탭·히어로의 '겉옷' 팁뿐 | `docs/검색_노출.md` 3장, `backend/services/weekend_plan.py` |
|
||||
| [ ] | 서치 콘솔: 홈 URL 검사(구조화 데이터 '날씨각' 인식 확인)·재크롤링 요청, 색인 생성 보고서에서 지역 페이지 몇 장 색인됐는지 확인 / 네이버 서치어드바이저: 주요 지역 페이지 수집 요청(네이버 색인 10/235) | 사이트 이름 '에이아이오투오' 표시, 지역 페이지 색인 부족 | `docs/검색_노출.md` 4장 |
|
||||
| [x] | 구글 서치 콘솔·네이버 서치어드바이저에 사이트 등록, `sitemap.xml` 제출 — 배포 뒤 (둘 다 등록됨, 10/13 확인) | 등록·제출 없으면 새 도메인은 색인이 늦음 | https://search.google.com/search-console , https://searchadvisor.naver.com |
|
||||
| [x] | 세션 여러 개가 같은 테스트 DB·Redis를 쓰면 서로 지움 — `TEST_DB_NAME`·`TEST_REDIS_DB`로 폴더마다 다르게 줄 수 있게 함 | 테스트 충돌 (10/7 두 번) | `backend/tests/conftest.py` |
|
||||
| [x] | 피드 행사 카드·띠를 축제→팝업→전시→콘서트 차례로 돌아가며 고름 (사용자 결정). 피드 행사 카드(최대 3장)가 연주회로 채워짐 — 시작일이 오늘에 가까운 순이라 하루짜리 콘서트(서울 170건)가 위를 차지. 기획엔 "축제·행사"만 있고 콘서트·팝업을 어떻게 섞을지 없음. 안: 종류별 1장씩(축제·전시·팝업 우선) 또는 피드에서 콘서트 제외 | 사용자 지적 | `backend/services/week_service.py` (`events` 정렬), `backend/services/feed_service.py` (`PostType.EVENT`), `docs/피드_기획.html` |
|
||||
| [x] | 피드 행사 카드·띠를 축제→팝업→전시→콘서트 차례로 돌아가며 고름 (사용자 결정). 피드 행사 카드(최대 3장)가 연주회로 채워짐 — 시작일이 오늘에 가까운 순이라 하루짜리 콘서트(서울 170건)가 위를 차지. 기획엔 "축제·행사"만 있고 콘서트·팝업을 어떻게 섞을지 없음. 안: 종류별 1장씩(축제·전시·팝업 우선) 또는 피드에서 콘서트 제외 | 사용자 지적 | `backend/services/week_service.py` (`events` 정렬), `backend/services/feed_service.py` (`PostType.EVENT`), `docs/서비스_동작_안내.md` 6장 |
|
||||
| [ ] | **[결정 필요]** 노을 하늘 상황 판정이 실제와 맞는지 확인할 방법 정하기 — 기준값(중·높은 구름 25~75% 등)은 추정값. 추천안: 서쪽이 트인 공개 웹캠·CCTV 6~8곳을 워커가 매일 '가장 붉을 때' 시각에 캡처하고, 같은 날 13시 기준 예보(상황·판정)를 따로 남김. 사람이 주 1회 사진에 잿빛/은은/고움/붉음 라벨(30분 내외) → 판정(나가 볼 만해요/애매/쉬어요) 3×3 적중표, 특히 '나가 볼 만해요' 적중률(목표 70%↑). 6~8주(약 300장)면 기준값 조정 가능. 비용 0원, 테이블 1개+워커 잡 1개+라벨 CSV로 2~3일. 결정할 것: 웹캠 출처·이용 조건, 라벨 담당 | 노을 탭 다시 기획 (10/7). 사용자 '예뻤어요/별로'는 출시 전엔 표본이 없고 출시 후 보조 지표로, 기상청 ASOS 운량은 전운량·중하층운량만이라 구름 입력 검증용이지 노을이 예뻤는지는 못 알려줌, 인스타 해시태그는 예쁜 날만 올라와 '쉬어요' 검증 불가·수집 약관 문제. `sky_score`는 갱신 때 덮어쓰고 7일 뒤 지워져 지금은 과거 예보가 안 남음 | `backend/services/calc/sky_score.py` (`situation`), `backend/services/sky_service.py`, `backend/scheduler/jobs.py` |
|
||||
| [x] | 공유 이미지: 행사 카드의 장소(지도 링크)가 빠짐 — 버튼과 함께 `<a>`도 빼서 생김. 링크는 남기고 버튼만 빼야 함 | 공유 이미지 점검 (10/7) | `frontend/src/b/storyImage.ts` (`keep`), `frontend/src/b/ui.tsx` (지도 링크) |
|
||||
| [x] | 공유 이미지: 행사 사진은 백엔드 `/v1/image`(허용 호스트만)로 대신 받음 (사용자 결정). 행사 사진(한국관광공사·문화정보원)이 CORS 차단으로 하얗게 빠짐. 안: 백엔드가 사진을 대신 받아 주기 / 공유 때만 사진 대신 아이콘 | 공유 이미지 점검 (10/7) | `frontend/src/b/storyImage.ts`, `backend` 이미지 응답 |
|
||||
@@ -236,7 +238,7 @@
|
||||
| [ ] | **[결정 필요]** 포스트 시도 단위가 17이 아니라 16 — `region.code` 앞 2자리에서 광주·전남이 둘 다 `12`(전남광주통합특별시)라 같은 댓글창을 씀. 그대로 둘지, 이름 앞머리로 광주·전남을 나눌지 | 포스트 시도 나누기 (10/8) | `backend/services/feed_service.py` (`sido_of`), `backend/seed/region.csv` |
|
||||
| [ ] | 광주·전남 구는 행사가 안 잡힐 수 있음 — 구 코드 시도는 `12`인데 행사 수집·`event.sido_code`는 `29`(광주)·`46`(전남). 좌표 없는 행사는 `is_nearby`·`nearby_sidos`에서 빠짐 | 포스트 시도 나누기 중 발견 (10/8) | `backend/services/week_service.py:125,144`, `backend/services/external/culture_api.py:28` |
|
||||
| [ ] | **[결정 필요]** 앱인토스 입점 여부 — 검토안은 "웹 출시 후 보기 전용 토스판으로 시험, 첫 달 포인트·알림 20~30만 원, 5주차에 포인트 없는 주의 7일 재방문율 20%를 기준으로 계속/중단" (https://claude.ai/artifact/QgA7iq3CCesTRYcFyZck71) | 앱인토스 검토 | |
|
||||
| [ ] | **[결정 필요]** 토스판 광고 — 앱인토스 수익은 토스 광고·인앱결제뿐인데 웹은 '광고 없음'으로 정함. 안 붙이면 토스판은 비용만 드는 홍보 채널 | 앱인토스 검토 | |
|
||||
| [ ] | 토스판 광고 — 결정함(11/23): 토스판에만 보상 없는 '광고 보고 응원하기' 카드(`tossAd.tsx`), 웹·앱은 계속 '광고 없음'. 광고 그룹 `보상형 광고 1차(각)`가 2026-12-02 에 삭제 예정이라 그 전에 `build:toss` 번들을 콘솔에 올려 노출시켜야 함(검수 3~5영업일). 운영 번들은 `frontend/.env.toss` 에 `VITE_TOSS_REWARD_AD_ID`(라이브 ID)를 넣고 만들 것 — 없으면 테스트 ID 로 동작 | 앱인토스 메일(11/23) | `frontend/src/b/tossAd.tsx` |
|
||||
| [ ] | 앱인토스 사전 확인 — 시간대별 밤 배경이 '라이트 모드' 규칙에 걸리는지, 네이버 지도 링크가 '단순 정보 확인' 예외인지 채널톡 문의 | 앱인토스 검토 | `frontend/src/b/BLayout.tsx`, `frontend/src/b/ui.tsx` |
|
||||
| [ ] | **[결정 필요]** 각 34개 정리 — 계절 밖 각(10월 물놀이·냉면) 노출 막기(각별 '보여 줄 달'), 나쁜 일 예고 각(택시대란·배달폭주·김서림·화장붕괴)을 순위에서 빼고 '조심' 카드로, 날씨 관계 약한 재미 각(공부·넷플릭스·짬뽕·막걸리·뜨아·군밤·집콕) 축소 또는 '재미' 표시 (https://claude.ai/artifact/4WgpUjdNqdSNnMN4ASB4BB) | 토스판 전략 검토 | `backend/seed/index_definition.json`, `backend/services/index_service.py` |
|
||||
| [ ] | 글 재고 부족 — 25편(한 문장 8·시 3·상식 4·계절 9)이라 매일 보면 1~2주 안에 반복, 계절 글은 10월분뿐. 기획의 'AI 주 1회 생성'이 스케줄러에 없음. 8주치 재고 또는 생성·검토 파이프라인 | 토스판 전략 검토 | `backend/seed/article.json`, `backend/scheduler/jobs.py` |
|
||||
@@ -251,7 +253,7 @@
|
||||
| [x] | 노을: 점수 강조(히어로에 점수 크게) → 사용자가 '29점이 키포인트 정보냐'고 해 히어로는 다시 시각 크게, 점수는 결론 카드 아래 줄로(10/12). 골든아워·블루아워 설명. 결론은 다음에 오는 것(해 뜨기 전·밤엔 일출, 그 사이엔 노을)으로, 피드 노을 카드도 같이 (사용자 결정 '각·노을도 지금 기준') | 10/8 회의, 사용자 결정 | `frontend/src/b/SkyPage.tsx`, `backend/services/sky_service.py` |
|
||||
| [x] | 주말 예보 UI 개선 → 피드 주말 예보 카드: 토·일 칸을 제목 바로 아래로(칸이 바닥에 붙어 가운데가 비어 오류처럼 보였음), 칸마다 '이날 할 만한 각' 3개 (사용자 의견) | 10/8 회의 | `frontend/src/b/WeekPage.tsx` |
|
||||
| [ ] | AEO·SEO 메타데이터 + 구글·네이버 검색 등록 (금일 핵심 업무), 넣은 태그·키워드 정의서 작성, 매시간 갱신 콘텐츠 노출 방식 정리 → 대표 보고. 도메인은 별도 유지 | 10/8 회의 결정 | `frontend/index.html`, `docs/` |
|
||||
| [ ] | `docs/콘텐츠_구현기획.md` 2-1의 오늘 날씨 점수 식이 예전 기준(기온 40·비 30·바람 15·미세먼지 15) — 새 기준은 `docs/점수_계산식.md` | 점수 계산식 정리 중 발견 (10/8) | `docs/콘텐츠_구현기획.md` |
|
||||
| [x] | 콘텐츠 구현 기획 문서 2-1의 오늘 날씨 점수 식이 예전 기준(기온 40·비 30·바람 15·미세먼지 15) — 그 문서를 지워(10/29 docs 정리) 해당 없음. 기준은 `docs/점수_계산식.md` | 점수 계산식 정리 중 발견 (10/8) | |
|
||||
| [ ] | **[결정 필요]** 각 순위가 점수 순이 아니라 보임 — 순위가 점수 × 중요도라 환기각 92점(하)이 5위, 골프각 89점이 3위, 빨래각 83점이 2위. 각 탭 받침대·스토리에서 높은 점수가 뒤에 있어 어색함. 점수를 순위대로 보여줄지, 중요도 가중을 줄일지 | 화면 직접 확인 중 발견 (10/12) | `backend/services/calc/index_calc.py` (`PRIORITY_WEIGHT`), `frontend/src/b/GakPage.tsx` |
|
||||
| [x] | 노을 점수 29점(잿빛)인데 결론 '나가 볼 만해요' — 결론이 구름 분포만 보고 공기 보정(가시거리·습도)을 안 봤음 → 공기 보정 0.7배 미만이면 결론 한 단계 낮추고 이유에 공기 표시, '해 질 무렵(N시) 예보 기준' 표시. 운영 DB에 `sky_score.air` 칸 추가 필요(배포 때 `init.sql`의 ALTER) | 사용자 지적 (10/12, 분당구) | `backend/services/sky_service.py` (`day_verdict`, `build_plan`), `backend/services/calc/sky_score.py` (`air_note`) |
|
||||
| [x] | 노을 탭 다시 짜기 → 시안 A(사용자 선택): 히어로 '오늘은 애매해요 / 18:10쯤 가장 붉어요 / 쉬운 이유', 내일 안내 바로 아래, 숫자는 '자세히', 시간표에 가장 붉을 때 — 처음 보면 '그래서 가?'에서 멈춤: 히어로 18:00이 무슨 시각인지 없음, 결론 카드가 좋은 말·나쁜 말을 섞음, 구름 %·예보 모델 수 같은 전문 용어, '가장 붉을 때'가 시간표에 없음, '내일이 더 나아요'가 맨 아래. 시안 먼저 보고 결정 | 사용자 지적 (10/12) | `frontend/src/b/SkyPage.tsx`, `backend/services/calc/sky_score.py` (`reason`) |
|
||||
@@ -261,6 +263,7 @@
|
||||
| [ ] | 토스 로그인 문구 검토 — '토스로 로그인', '토스로 로그인했어요', '토스 로그인을 마치지 못했어요. 한 번 더 눌러 주세요.', 기본 닉네임 '토스1234'(userKey 끝 4자리), 로그인 창 '날씨각 로그인'·'로그인하면 동네 이야기를 쓰고 내 각을 저장할 수 있어요', 인트로 '오늘 날씨에 맞는 일을 점수로 알려 줘요'·'세차·빨래·러닝 각 점수'·'오늘 노을이 예쁜 시간'·'이번 주말 가까운 행사'·'시작하기'(10/24) | 토스 로그인 구현(10/14) | `frontend/src/b/Sheets.tsx`, `backend/services/auth_service.py` |
|
||||
| [ ] | 토스판 첫 실행에 인트로와 위치 권한 창이 같이 뜸 — 위치 권한은 앱이 뜨자마자 물어서 인트로 위에 겹칠 수 있음. '시작하기' 뒤로 미룰지 토스 앱에서 확인 | 인트로 추가 (10/24) | `frontend/src/b/region.tsx`, `frontend/src/b/tossIntro.tsx` |
|
||||
| [ ] | 메뉴의 '로그인하면 좋아요·댓글을 쓸 수 있어요' — 좋아요·댓글은 로그인 없이 됨(10/21 결정)이라 문구가 틀림 | 인트로 추가 중 발견 (10/24) | `frontend/src/b/Sheets.tsx:1117` |
|
||||
| [ ] | 토스 웹뷰에서 유튜브 플레이어가 보내는 재생 상태(postMessage)가 페이지에 오지 않음 — 원인 미확인(origin 불일치? 토스 브리지?). 그래서 토스판 쇼츠는 숨기기·명령 없이 유튜브 기본 플레이어 사용. 원인 찾으면 웹과 같은 UI로 합칠 수 있음 | 토스판 쇼츠 재생 안 됨 (10/26) | `frontend/src/b/Shorts.tsx` |
|
||||
| [ ] | 댓글 신고·차단 — 앱인토스 필수 아님(신고·차단 필수는 채팅·만남·중고거래만, 서비스 오픈 정책·서비스별 주의사항). 만들지 않기로 함(10/14). 검수에서 요청이 오면 만든다 | 토스 로그인 구현(10/14) | |
|
||||
| [x] | 각 늘리기 53→68 — 리서치로 고른 8개(한강·놀이공원·데이트·곱슬머리·보일러·선크림·모기·테니스) + 감성 7개(효도·감사·선물·파티·게임·셀카·센치), 아이콘 15개(Codex) | 사용자 요청 (10/20, 리서치 https://claude.ai/artifact/3ZQbtGKRLVZViRRC5voBzY) | `backend/seed/index_definition.json`, `frontend/public/icons/`, `frontend/src/b/lib.ts` |
|
||||
| [ ] | **[결정 필요]** 한강각·놀이공원각이 강·놀이공원 없는 동네에도 나옴 — 각을 지역별로 가려 보여 주는 기능이 없음(한강밤바람각도 같음). 서울·한강 인접 구만 보일지 | 새 각 추가 중 발견 (10/20) | `backend/seed/index_definition.json`, `backend/services/index_service.py` |
|
||||
@@ -280,16 +283,16 @@
|
||||
|
||||
| 상태 | 할 일 | 이유 | 관련 파일 |
|
||||
|---|---|---|---|
|
||||
| [ ] | **[결정 필요]** 인스타 계정 이름·화자 — 토끼·곰 캐릭터를 말하는 사람으로 쓸지 | 인스타 홍보 기획 | `docs/인스타_홍보_기획.html` |
|
||||
| [ ] | **[결정 필요]** '오늘의 각' 카드 기준 지역 — 서울만 / 서울·부산 2장 / 시도별 | 전국 계정인데 각은 동네마다 다름 | `docs/인스타_홍보_기획.html` |
|
||||
| [ ] | **[결정 필요]** '화제 × 날씨'에 쓰지 않을 주제 목록과 올리기 전 검토 담당 | 역풍 위험 (사고·재난·정치·연예인 사생활) | `docs/인스타_홍보_기획.html` |
|
||||
| [ ] | **[결정 필요]** 날씨 타로 카드 앞면 그림(날씨별 한 벌) 제작 담당 — 4주 실험, 보내기·저장·댓글이 계정 평균 못 넘으면 중단 | 운세 결합 판단 (10/20 띠별 대신 타로로 결정) | `docs/인스타_홍보_기획.html` |
|
||||
| [ ] | **[결정 필요]** 인스타 카드 자동 생성 — 공유 이미지 카드를 4:5로 뽑는 기능을 만들지, 처음엔 사람이 만들지 | 매일 게시 비용 | `docs/인스타_홍보_기획.html` |
|
||||
| [ ] | **[결정 필요]** 오늘의 OOTD(아침 카드 2장째) — 캐릭터 옷 그림을 기온 구간별로 한 벌 만들 담당과 구간 기준 (히어로 일교차 '아침엔 겉옷'·주말 옷차림 팁과 같은 기준을 쓸지) | 10/20 OOTD 추가 결정 | `docs/인스타_홍보_기획.html`, `backend/services/hero_stats.py`, `backend/services/weekend_plan.py` |
|
||||
| [ ] | 인스타 매일 자동 생성 — `admin/`이 예보 갱신 직후 날씨각 API에서 각 순위·기온·OOTD 구간을 HTML 틀에 넣어 JPEG(4:5)로 저장, 그림은 미리 만든 한 벌 재사용 (10/20 사용자 결정: 자동 생성 + 승인 + 자동 게시, 저장소 안 관리자 프로젝트 `admin/`의 기능 하나, API는 공용) | 인스타 홍보 7장 | `admin/`, `docs/인스타_홍보_기획.html` |
|
||||
| [ ] | `admin/` 관리자 화면 — (10/21 됨: 인스타 카드 미리보기·문구 수정·JPEG 내려받기, `npm run card` 대화용 명령, 템플릿 3종) 남은 것: 매일 자동 생성 저장·승인/반려·게시 결과, 관리자 로그인(지금은 로그인 없이 로컬에서만), 배포(compose). 10/21 추가로 됨: 지역 콘텐츠 제거(오늘의 각 템플릿 삭제, 서울 예보 기준), 코디 6명, Claude 주제 기획·피드백 재기획(웹·`npm run card --topic`) | 인스타 홍보 7장 | `admin/`, `docs/인스타_홍보_기획.html` |
|
||||
| [ ] | `admin/` 인스타 API 자동 게시 — 승인된 게시물을 정한 시각에 게시, 승인 마감까지 승인 없으면 게시 안 함. 이미지는 공개 주소에 JPEG | 인스타 홍보 7장 | `docs/인스타_홍보_기획.html` |
|
||||
| [ ] | **[결정 필요]** 매일 승인 담당자·승인 마감 시각·게시 시각, 프로페셔널 계정 전환과 Meta 앱 생성 담당(우리 계정만 쓸 때 앱 검수 필요한지 확인) | 인스타 홍보 7장 | `docs/인스타_홍보_기획.html` |
|
||||
| [ ] | **[결정 필요]** 인스타 계정 이름·화자 — 토끼·곰 캐릭터를 말하는 사람으로 쓸지 | 인스타 홍보 기획 | `docs/인스타_운영.md` 2장 |
|
||||
| [ ] | **[결정 필요]** '오늘의 각' 카드 기준 지역 — 서울만 / 서울·부산 2장 / 시도별 | 전국 계정인데 각은 동네마다 다름 | `docs/인스타_운영.md` 2장 |
|
||||
| [ ] | **[결정 필요]** '화제 × 날씨'에 쓰지 않을 주제 목록과 올리기 전 검토 담당 | 역풍 위험 (사고·재난·정치·연예인 사생활) | `docs/인스타_운영.md` 2장 |
|
||||
| [ ] | **[결정 필요]** 날씨 타로 카드 앞면 그림(날씨별 한 벌) 제작 담당 — 4주 실험, 보내기·저장·댓글이 계정 평균 못 넘으면 중단 | 운세 결합 판단 (10/20 띠별 대신 타로로 결정) | `docs/인스타_운영.md` 2장 |
|
||||
| [ ] | **[결정 필요]** 인스타 카드 자동 생성 — 공유 이미지 카드를 4:5로 뽑는 기능을 만들지, 처음엔 사람이 만들지 | 매일 게시 비용 | `docs/인스타_운영.md` 2장 |
|
||||
| [ ] | **[결정 필요]** 오늘의 OOTD(아침 카드 2장째) — 캐릭터 옷 그림을 기온 구간별로 한 벌 만들 담당과 구간 기준 (히어로 일교차 '아침엔 겉옷'·주말 옷차림 팁과 같은 기준을 쓸지) | 10/20 OOTD 추가 결정 | `docs/인스타_운영.md` 2장, `backend/services/hero_stats.py`, `backend/services/weekend_plan.py` |
|
||||
| [ ] | 인스타 매일 자동 생성 — `admin/`이 예보 갱신 직후 날씨각 API에서 각 순위·기온·OOTD 구간을 HTML 틀에 넣어 JPEG(4:5)로 저장, 그림은 미리 만든 한 벌 재사용 (10/20 사용자 결정: 자동 생성 + 승인 + 자동 게시, 저장소 안 관리자 프로젝트 `admin/`의 기능 하나, API는 공용) | 인스타 홍보 7장 | `admin/`, `docs/인스타_운영.md` 2장 |
|
||||
| [ ] | `admin/` 관리자 화면 — (10/21 됨: 인스타 카드 미리보기·문구 수정·JPEG 내려받기, `npm run card` 대화용 명령, 템플릿 3종) 남은 것: 매일 자동 생성 저장·승인/반려·게시 결과, 관리자 로그인(지금은 로그인 없이 로컬에서만), 배포(compose). 10/21 추가로 됨: 지역 콘텐츠 제거(오늘의 각 템플릿 삭제, 서울 예보 기준), 코디 6명, Claude 주제 기획·피드백 재기획(웹·`npm run card --topic`) | 인스타 홍보 7장 | `admin/`, `docs/인스타_운영.md` 2장 |
|
||||
| [ ] | `admin/` 인스타 API 자동 게시 — 승인된 게시물을 정한 시각에 게시, 승인 마감까지 승인 없으면 게시 안 함. 이미지는 공개 주소에 JPEG | 인스타 홍보 7장 | `docs/인스타_운영.md` 2장 |
|
||||
| [ ] | **[결정 필요]** 매일 승인 담당자·승인 마감 시각·게시 시각, 프로페셔널 계정 전환과 Meta 앱 생성 담당(우리 계정만 쓸 때 앱 검수 필요한지 확인) | 인스타 홍보 7장 | `docs/인스타_운영.md` 2장 |
|
||||
| [ ] | **[결정 필요]** 인스타 카드 기본 문구 검토 — 템플릿 3종(`admin/src/cards/templates.tsx` `defaults`)의 기본 문구와 OOTD 기온 구간·옷 이름(`admin/src/cards/ootd.ts`)이 아직 검토 전. 타로 결과 장 문장은 '각 요약 + ○○이 가장 좋아요'라 세 장이 비슷하게 나올 수 있음 | 관리자 프로젝트 첫 구현 (10/21) | `admin/src/cards/templates.tsx`, `admin/src/cards/ootd.ts` |
|
||||
| [x] | OOTD 옷 그림 — 지금은 낮 최고 17~22도 구간 한 장만 있음, 나머지 6구간은 옷 이름만 나감. Codex로 구간별 플랫레이(사람·얼굴 없이) 생성 → 10/21 프롬프트 템플릿(`admin/image-prompts/ootd.json`) + `npm run gen-image`로 7구간 모두 생성, 그림이 있으면 카드에 자동으로 붙음 | 관리자 프로젝트 첫 구현 (10/21) | `admin/src/assets/`, `admin/src/cards/ootd.ts` |
|
||||
| [ ] | 코디 그림 6명 × 7구간(42장) 중 7장만 있음 — 오늘 구간(12~16도) 5장은 Codex 사용 한도로 실패(10/21 14:36 이후 가능). `cd admin && npm run gen-image -- ootd missing` | 코디 6명 나누기 (10/21) | `admin/image-prompts/ootd.json`, `admin/src/assets/ootd/` |
|
||||
@@ -325,6 +328,8 @@
|
||||
| [x] | 10/28 세미정장 코디(철회: 20-30대 남자에 나팔바지라는 피드백, 포스트 4903 10/28 삭제함(deleted=true)·인스타 앱에서 삭제 필요) — 킹서버 카드 23→포스트 4903, 인스타 https://www.instagram.com/p/DfBIhUdAbbV/. 참고 스냅 f20 https://www.musinsa.com/snap/1560205304641814679 · m20 https://www.musinsa.com/snap/1551785083122597386 · f40 https://www.musinsa.com/snap/1551572173880406114 · m40 https://www.musinsa.com/snap/1556284432455808475. 4장 1:1 검수. 크롬이 2번째 장 렌더에서 멈춰 장마다 프로필을 따로 써서 다시 찍음, 인스타 API는 request limit을 돌려줬지만 실제 게시됨(ig_media_id 미기록) | 사용자 요청 (10/28) | `admin/scripts/card.mjs` |
|
||||
| [x] | 10/28 세미정장 코디 다시(20-30대 남자만 교체: 오피서 코트·헨리넥 니트·다크 브라운 와이드 팬츠·헤비 부츠·토트백, 코디 구성을 먼저 확인받고 그림) — 킹서버 카드 24→포스트 4904, 인스타 https://www.instagram.com/p/DfBJ4SlAaok/. 참고 스냅 m20 https://www.musinsa.com/snap/1562338908609136514 (나머지 3명은 카드 23과 같음). 첫 그림은 상품 썸네일을 따라 바지가 베이지로 나와 스냅 색(브라운)으로 다시 그림 | 사용자 요청 (10/28) | `admin/scripts/daily-ootd.mjs` |
|
||||
| [x] | 10/28 연애 타로(단풍각·데이트각·별보기각, 새 표지: 주제 배지 + 큰 질문) — 킹서버 카드 26→포스트 4906, 인스타 https://www.instagram.com/p/DfBQCW0ARgL/ (ig_media_id 17953447719320497). 처음 올린 카드 25→포스트 4905(인스타 DfBPIHJAR0m)는 행운 포인트가 날씨 정보뿐이라는 피드백으로 철회: 포스트 4905 deleted=true, 인스타 글은 앱에서 삭제됨. 행운 포인트를 "시각 · 행운 아이템"(리딩 속 행동에 쓰는 물건)으로 바꿔 다시 게시. 문구를 먼저 확인받음: 첫 기획의 행운 포인트(6시 1도·10시 바람)를 예보 slot 값으로 고치고, 연애와 관련 없는 카드(해돋이각·테니스각)를 데이트각·별보기각으로 바꿈. 5장 1:1 검수. 인스타 API는 두 번 다 request limit을 돌려줬지만 실제 게시됨(최신 글 확인 후 재시도 안 함) | 사용자 요청 (10/28) | `admin/src/cards/templates.tsx`, `admin/scripts/plan.mjs` |
|
||||
| [x] | 10/30 나들이 타로(억새각·캠핑각·야장각, 질문 "이번 주말, 어디로 놀러 갈까요?", 행운 시각은 토요일 서울 예보) — 킹서버 카드 29→포스트 6713, 인스타 https://www.instagram.com/p/DfGhl5YgUqE/ . 인스타 API가 'Application request limit reached'를 돌려줬지만 실제로 올라가 다시 안 올림(card_set.ig_media_id 는 비어 있음). '나들이'는 대주제 배경(skin)이 없어 star 태그(#공부 #직장인)가 붙던 것을 copy.tags 로 #주말나들이 #주말뭐하지 #가을나들이 #나들이타로 로 바꿈. 관리자 서버가 옛 로컬 백엔드(9810, /v1/index/list 500)를 보고 있어 운영 API(weather.o2o.kr)로 다시 켬 | 인스타 홍보 | `admin/src/cards/templates.tsx` |
|
||||
| [x] | 10/30 할로윈 느낌 캐주얼 코디(블랙·브라운 톤 — 무신사 인기 스냅에 주황 코디가 거의 없어 할로윈 색 중 블랙·브라운으로) — 킹서버 카드 31→포스트 6714, 인스타 https://www.instagram.com/p/DfGj0zRAdhx/ (ig 17864943492694006, 첫 시도 ReadTimeout·둘째 'request limit' 응답이었지만 한 번만 올라감, card_set.ig_media_id 는 비어 있음). 참고 스냅: 20-30대 여자 https://www.musinsa.com/snap/1559108562982052217 · 20-30대 남자 https://www.musinsa.com/snap/1561961004027044406 · 40대~ 여자 https://www.musinsa.com/snap/1564225528677543586 · 40대~ 남자 https://www.musinsa.com/snap/1555156723956691019. 검수에서 스냅 사진과 달라 다시 그림: 20대 여자 플랫 검정→브라운, 40대 여자 부츠 발목→무릎 슬라우치, 40대 남자 하이넥 아이보리→브라운·신발 레이스업→스웨이드 첼시. 첫 카드 30은 반려 | 인스타 홍보 | `admin/scripts/snap.mjs` `--prefer` |
|
||||
| [x] | 각 카드 그림 미리 생성 — 가을에 나올 만한 28장(피크닉·캠핑·놀이공원·빨래·단풍·억새·테니스·골프·군고구마·붕어빵·군밤·사진산책·별보기·환기·세차·이불빨래·데이트·치맥·막걸리·파전·우산·넷플릭스·집콕·한강밤바람·멍뭉산책·센치·감성노래·낚시) + 기존 8 = 36/68. 여름·한겨울 전용 32장은 철 되면 생성 | 사용자 요청 (10/26) | `admin/src/assets/gak-card/` |
|
||||
| [ ] | 카드 자동화 다음 단계 — ① 생성 직후 자동 검사(Claude 비전: 옷 개수·사람·글자·추가 옷, 불합격 1회 재생성) ② 승인 대기 카드 메일/Teams 알림 + 서명 토큰 승인 링크(`GET /v1/card/{id}/approve`) ③ 맥 launchd 매일 06:30 `claude -p "/daily-cards"` ④ 그림 세트가 차면 킹서버로 이전 | 사용자 요청 (10/26) | `backend/router/v1/card/card.py`, `admin/scripts/` |
|
||||
| [ ] | 앱 헤더가 400~448px 폭에서 컨테이너를 넘쳐 로그인 버튼이 잘림(`frontend/src/b/BLayout.tsx` TopBar). 캡처는 456px로 찍어 피했지만 실제 폰(430·440px)에서도 잘릴 수 있음 | 10/24 캡처 중 발견 | `frontend/src/b/BLayout.tsx` |
|
||||
@@ -386,3 +391,81 @@
|
||||
| [ ] | 들어가는 길 — 지금은 `/game` 주소로만 열림. 피드 카드·메뉴 노출 여부 결정 | 사용자 선택 (10/28) | `frontend/src/App.tsx` |
|
||||
| [ ] | 라운드 목표 점수(200 + 라운드마다 80) — 시간 제한은 없앰(사용자 10/28). 1초에 1번 아무 데나 떨어뜨리면 4~13라운드에서 넘침. 실제 사람 플레이 보고 조정 | 라운드 추가 (10/28) | `frontend/src/b/cloudMerge.ts` `roundTarget` |
|
||||
| [x] | 라운드 각 — 라운드를 깰 때마다 2각, 하루 20각(사용자 결정 10/28). 로그인한 사람만, 판 시작 표(서명)로 남의 판·위조 거절, 라운드당 15초 안 지나면 거절. 레벨업 창은 판이 끝난 뒤에 | 계정 레벨과 연결 (10/28) | `backend/services/level_service.py` `game_token`, `frontend/src/b/CloudMergePage.tsx` `claimRound` |
|
||||
|
||||
## 10/29 docs 정리 — 코드와 다른 문서 내용, 옮긴 할 일
|
||||
|
||||
docs를 6개로 합칠 때 옛 내용을 그대로 옮겼다. 아래는 코드와 다른 곳이다.
|
||||
|
||||
| 상태 | 할 일 | 이유 | 관련 파일 |
|
||||
|---|---|---|---|
|
||||
| [ ] | 피드 칸 수 19개 → 지금 25칸(포스트 1~20 + 히어로·오늘의 각·단풍·행사 띠·계절 띠 자리 21~25). 1-1 정기 작업 표, 3-1, 4-1·4-2·4-3에 19칸으로 적힘 | 코드와 다름 | `docs/서비스_동작_안내.md`, `backend/services/feed_service.py` (`LINEUP`) |
|
||||
| [ ] | 각 개수 34·27개 → 지금 68개. 서비스_동작_안내 2-1·2-2('각 27개')·4-3('각 점수 27개', '오늘의 각 줄(34개)'), 점수_계산식 10-7·부록('각 34개'), 검색_노출 2-3('34개 중 10개') | 코드와 다름 | `backend/seed/index_definition.json` |
|
||||
| [ ] | 밤 지금 날씨 점수 '최대 64점' → 지금은 가장 낮은 요소로 깎지 않고 구간별 표시 점수로 바꿈(점수_계산식 3장). 점수_계산식 10-6, 서비스_동작_안내 8장 | 코드와 다름 | `docs/점수_계산식.md`, `docs/서비스_동작_안내.md`, `backend/services/calc/index_calc.py` (`_weighted`) |
|
||||
| [ ] | 시간대별 피드 순서 → 코드 `ORDER`와 다름(예: 아침은 특보 → 주말 예보 → 주말 플랜 → 노을 → 각 순). 서비스_동작_안내 3-3, 4-3 '시간대별 기본 순서' | 코드와 다름 | `backend/services/feed_service.py` (`ORDER`) |
|
||||
| [ ] | 정기 작업 — 1-1 표에 쇼츠 받기(매일 7·12·18시 10분) 없음. 1-3 '정해진 시각에 도는 작업은 새벽 3시 하나뿐'·1-4 스케줄러 줄은 틀림(Open-Meteo 하루 4번, 주말 점수 하루 2번, 행사 주 1번, 쇼츠 하루 3번도 돎) | 코드와 다름 | `docs/서비스_동작_안내.md`, `backend/worker_main.py` |
|
||||
| [ ] | 포스트 종류별 내용(5장)이 13종 기준 — `PostType` 21개 중 자외선(UV)·히어로·오늘의 각·단풍·행사 띠·계절 띠·카드뉴스(CARD) 설명 없음 | 코드와 다름 | `docs/서비스_동작_안내.md` 5장, `backend/common/enums.py` (`PostType`) |
|
||||
| [ ] | 화면별 데이터 출처(2장)에 이야기·사주·운세·레벨·나만의 각·쇼츠·카드·릴스·워치 API 없음 | 코드와 다름 | `docs/서비스_동작_안내.md` 2장, `backend/router/v1/` |
|
||||
| [ ] | 태그·키워드(검색_노출 2장) — `<title>`·description에 '날씨 사주'가 들어가 바뀜, sitemap은 빌드가 만듦(`frontend/public/sitemap.xml` 없음), 2-6 등록 현황 '배포 뒤' → 등록됨 | 코드와 다름 | `docs/검색_노출.md` 2장, `frontend/index.html`, `frontend/vite.config.ts` |
|
||||
| [ ] | 지역 페이지 수(검색_노출 1-1) 'HTML 230장, 주소 235개' → 구 주소 39장 추가(`96cbd19`) 뒤 숫자 다름 | 코드와 다름 | `docs/검색_노출.md` 1장, `frontend/seo/region.json` |
|
||||
| [ ] | 인스타_운영 1장 '각 카드 그림 36/68장' → 지금 47장 | 파일 수와 다름 | `docs/인스타_운영.md` 1장, `admin/src/assets/gak-card/` |
|
||||
| [ ] | `backend/docs/각_계산기준.md` 다시 만들기 — 생성기를 돌리면 야구각 점수 구간 문장 4줄이 바뀜(seed가 더 새것) | seed와 다름 | `backend/scripts/gen_gak_doc.py` |
|
||||
| [ ] | 휴대폰에서 지역 페이지 확인 — 시 안에서 내 구로 바뀌는지, 지역을 바꾸면 주소가 바뀌는지 | 10/14 작업 정리에서 옮김. 로컬에서 확인 못 했다 | `frontend/src/b/region.tsx` |
|
||||
| [ ] | 없는 지역 주소가 200으로 홈을 보여 주는 것 | 10/14 작업 정리에서 옮김. SPA 기본 동작이고 canonical이 홈이라 당장 문제는 없다 | `frontend/nginx.conf` |
|
||||
| [ ] | 검색 결과 요약의 "해 지는 시각"을 노을이 가장 붉은 시각으로 바꿀지 | 10/14 작업 정리에서 옮김. 지금은 계산으로 나온 일몰 시각 | `backend/services/seo_service.py` |
|
||||
|
||||
## 앱인토스 남은 단계
|
||||
|
||||
`docs/서비스_동작_안내.md` 7장(토스판)의 남은 단계와 토스에 물어볼 것. 각 단계가 끝나면 확인을 받고 다음 단계로 간다. 작업 브랜치는 `feat/apps-in-toss`.
|
||||
|
||||
| 상태 | 할 일 | 이유 | 관련 파일 |
|
||||
|---|---|---|---|
|
||||
| [ ] | 0단계(사람): 앱인토스 콘솔 가입, 앱 등록 → `appName` 확정 (https://apps-in-toss.toss.im) | 콘솔 앱 `nalssigak`은 10/13 맞춤(위 '앱인토스 appName' 행) — 정식 등록 여부 확인 | `frontend/apps-in-toss.config.ts` |
|
||||
| [ ] | 0단계(사람): 사업자 정보 등록 (영업일 기준 약 1일) | 사전 준비 | |
|
||||
| [ ] | 0단계(사람): 샌드박스 앱을 테스트 폰에 설치 | 사전 준비 | |
|
||||
| [ ] | Q1. WebView에서 `BrowserRouter`(주소 경로)로 화면을 나눠도 되는가 | 토스 문의(채널톡·개발자 커뮤니티). 안 되면 `HashRouter` | `frontend/src/App.tsx` |
|
||||
| [ ] | Q2. 미니앱 안에서 GA4(`gtag.js`)를 써도 되는가 | 토스 문의 | `frontend/index.html`, `frontend/src/lib/analytics.ts` |
|
||||
| [ ] | Q3. 시간대에 따라 밤에 어두운 배경을 쓰면 '라이트 모드' 규칙에 걸리는가 | 토스 문의 (위 '앱인토스 사전 확인' 행과 같음) | `frontend/src/b/BLayout.tsx` |
|
||||
| [ ] | Q4. 장소 이름을 누르면 네이버 지도로 가는 링크가 '단순 정보 확인' 예외에 해당하는가 | 토스 문의 (위 '앱인토스 사전 확인' 행과 같음). '예외 해당'이면 지도 링크를 되돌림 | `frontend/src/b/ui.tsx` (`MapLink`) |
|
||||
| [x] | Q5. 공유창으로 이미지 파일(공유 카드)을 보낼 수 있는가 — SDK 기준 불가(`Share.sendMessage`는 글만). 지금은 이미지를 저장하고 링크를 보낸다 | 토스 문의 | `frontend/src/lib/platform.ts` |
|
||||
| [ ] | Q6. TDS는 '강력 권장'인데 React 19 프로젝트도 TDS 없이 검수를 통과하는가 (TDS는 React 18 필요) | 토스 문의 | |
|
||||
| [ ] | Q7. 카테고리 목록. '나들이·여가' 같은 분류가 있는가 | 토스 문의 | |
|
||||
| [ ] | 1단계: 샌드박스 앱에서 피드가 뜨는지 확인 — 콘솔 앱 등록·샌드박스 설치 뒤. 완료 기준: 웹 빌드 결과가 바뀌지 않고, 샌드박스에서 피드가 열린다 | 토스 빌드 뼈대 | |
|
||||
| [ ] | 2단계: 운영 서버에 mTLS 인증서 두기, `.env`에 `TOSS_MTLS_CERT`·`TOSS_MTLS_KEY`·`TOSS_UNLINK_AUTH`, compose 마운트 | 토스 로그인 | `compose.yaml` |
|
||||
| [ ] | 2단계: 콘솔에 토스 로그인 약관 동의·동의 항목·연결 끊기 콜백 등록 | 토스 로그인 | |
|
||||
| [ ] | 2단계: Q1~Q3 답에 따라 라우터·GA4·밤 배경 처리 (지금은 웹과 같음). 완료 기준: 웹은 지금과 똑같이 동작하고, 토스에서는 토스 로그인으로만 로그인한다 | 플랫폼 분기 | `frontend/src/lib/platform.ts` |
|
||||
| [ ] | 3단계(결정 대기): 토스판 피드 줄이기 — '각 34개 정리', '히어로 숫자 5개' 결정 뒤. 목표는 피드 8~10칸, 첫 화면에 한 줄 판정. 문구는 목록으로 검토받은 뒤 반영 | 토스판 전략 | |
|
||||
| [ ] | 4단계: 샌드박스 실기기 확인 — 첫 화면 뒤로가기를 누르면 앱이 닫힌다, 진입하자마자 바텀시트가 뜨지 않는다, 상단 바 버튼이 1개다, 위치 권한을 거부해도 지역 선택으로 쓸 수 있다 | 검증 | |
|
||||
| [ ] | 4단계: [비게임 검수 체크리스트](https://developers-apps-in-toss.toss.im/checklist/app-nongame.md)와 항목별로 대조 | 검증 | |
|
||||
| [ ] | 4단계: 토스 공식 `project-validator` 스킬로 점검 (https://github.com/toss/apps-in-toss-skills) | 검증 | |
|
||||
| [ ] | 5단계: 웹 출시가 끝났는지 확인 | 출시 | |
|
||||
| [ ] | 5단계: `.ait` 번들을 콘솔에 올리고 검수 요청 (3~5영업일, 반려 시 다시 3~5일) | 출시 | |
|
||||
| [ ] | **[결정 필요]** 6단계(출시 후): 스마트 발송(알림) — 금요일 주말 판정, 노을 좋은 날. 노을 알림은 위 '노을 알림 재검토' 행 | 출시 후 별도 결정 | |
|
||||
| [ ] | **[결정 필요]** 6단계(출시 후): 포인트 — 출시 후 2주만 쓰고 끊는다. 포인트를 끊은 주의 재방문율로 계속할지 판단 | 출시 후 별도 결정 | |
|
||||
|
||||
## GA 분석 (`/ga-report`, 기록은 `docs/이벤트_추적.md` '분석 기록')
|
||||
|
||||
| 상태 | 할 일 | 이유 | 관련 파일 |
|
||||
|---|---|---|---|
|
||||
| [ ] | **[결정 필요]** 자동 화면 테스트 트래픽을 GA에서 빼기 — ① 운영 사이트를 여는 Playwright 스크립트에서 GA 요청(googletagmanager·google-analytics)을 막기 ② GA4 관리 → 데이터 스트림 → 내부 트래픽 정의(사무실 IP) + 데이터 필터 활성 | 10/22~10/28 활성 206명 중 약 146명이 성남·아이폰 390x844(Playwright iPhone 기본 크기)·근무시간·참여 2~3초. 이대로면 사용자 수·전환율이 모두 틀림 | `/tmp/sweep/*.mjs` 등 Playwright 스크립트, GA4 관리 |
|
||||
| [ ] | **[결정 필요]** GA4 맞춤 측정기준(이벤트 범위) 추가 등록 — `icon`(today_icon)·`sheet`(sheet_open)·`from`·`method`·`content_type`·`round`(game) | 지금 등록된 건 `gak_name`·`platform`·`region_name` 뿐이라 오늘 탭 아이콘별·창별·게임 라운드별 사용을 GA에서 못 나눔. 등록 전 데이터는 소급 안 됨 | GA4 관리 → 맞춤 정의 |
|
||||
| [ ] | **[결정 필요]** '홈 화면에 추가' 카드 손보기 — 띄우는 조건(몇 번째 방문부터)·문구, 또는 빼기 | 10/22~10/28 테스트 트래픽 뺀 77명이 봤고 누른 사람 0 (앞 주 8명 중 1명 설치) | `frontend/src/b/installBanner.tsx` |
|
||||
|
||||
|
||||
## 기념일 꾸밈 (`frontend/src/b/holiday.ts`)
|
||||
|
||||
| 상태 | 할 일 | 이유 | 관련 파일 |
|
||||
|---|---|---|---|
|
||||
| [ ] | `feat/halloween` main 병합 → 킹서버 배포(백엔드 `TalkTopic` 6~9 포함). 10/31 00시 전에 올라가야 할로윈이 켜짐 | 10/30 킹서버 작업 중이라 배포 보류 | `deploy.sh` |
|
||||
| [ ] | 할로윈 타로·코디 카드 (`/daily-tarot 할로윈`, `/daily-ootd`) — 킹서버 게시라 보류 | 10/30 킹서버 작업 중 | |
|
||||
| [ ] | 2028년부터 추석 날짜 추가 (음력이라 해마다 `ranges` 에 한 줄) | 2027-09-14~16만 들어 있음 | `frontend/src/b/holiday.ts` |
|
||||
| [ ] | 수능 응원·연말·새해 기념일 배포 — 백엔드 `TalkTopic` 10·11 이 11/18 00시 전에 킹서버에 올라가야 수능 주제 글이 올라감. 앱은 새 빌드가 나가야 소품·게임 그림이 보임 | 11/12 수능(2026-11-18~19)·연말·새해(12-31~01-01) 추가 | `deploy.sh`, `shared/lib/holiday.ts` |
|
||||
| [ ] | 2027년 수능 날짜 추가 (11월 셋째 목요일, 해마다 `ranges` 에 한 줄) | 2026-11-18~19만 들어 있음 | `shared/lib/holiday.ts` |
|
||||
|
||||
## 검색 클릭률 (10/30)
|
||||
|
||||
| 상태 | 할 일 | 이유 | 관련 파일 |
|
||||
|---|---|---|---|
|
||||
| [ ] | `/today`·`/tomorrow` 검색 결과 새 문구(내일 제목 '○○ 내일 날씨 · 내일 1위는 ○○각', 날짜·지역 먼저인 설명)를 지역 절반에만 배포하고, 배포 2주 뒤 Search Console에서 두 그룹 클릭률 비교 + GA `search_landing` 의 `copy` 별 유입. 기준(10/7~27 클릭률): 내일 새 그룹 0.044%·예전 그룹 0.047%, 오늘 새 그룹 0.044%·예전 그룹 0.026% | 10/30 사용자: 색인 늘리기보다 클릭률. 10/30 배포, 11/13쯤 비교 (구글이 다시 가져가야 검색 결과 문구가 바뀜) | `backend/services/seo_service.py`, `backend/services/seo_copy_test.json` |
|
||||
| [ ] | (보류) `/foliage`·`/sky`·`/week` 서버 HTML에 실제 내용 넣기 — 새 URL 없이, 단풍 상태는 화면과 같은 4단계(단풍 전·첫 단풍·절정·절정 지남), 앱이 뜬 뒤에도 화면 아래에 글 남김. 지역 단풍·지역 주말 페이지는 안 만듦 | 10/30 사용자: 클릭률 먼저 | `frontend/vite.config.ts`, `frontend/nginx.conf`, `backend/services/seo_service.py` |
|
||||
| [ ] | 주말 순위가 Redis 13시간 보관이라 06:40·18:40 갱신이 두 번 연속 실패하면 비어 보임 — 마지막 정상값 따로 보관 | 10/30 조사 중 발견 | `backend/services/weekend_rank.py`, `backend/worker_main.py` |
|
||||
| [ ] | 오늘 페이지 설명에 "강수확률 60%, 비" 와 "낮은 한강각"이 같이 나옴(10/30 성남) — 하루 중 한 시간이라도 비면 "비"로 적는 요약과 시간대별 1위 각이 어긋나 보임. 계산이 맞는지 확인 | 10/30 클릭률 조사 중 발견 | `backend/services/seo_service.py` |
|
||||
@@ -11,6 +11,17 @@ VITE_API_BASE_URL=http://localhost:9810 npm run dev # http://localhost:5175
|
||||
|
||||
백엔드 주소가 다르면 `VITE_API_BASE_URL`만 바꾼다. 백엔드 API가 바뀌면 `npm run api`로 `src/api/client`를 다시 만든다.
|
||||
|
||||
## 윈도우
|
||||
|
||||
스킬(`.claude/commands/` 의 daily-tarot·daily-ootd·daily-cards·weekly-ootd-video)은 Git Bash 에서 맥과 같은 명령으로 돈다. 외부 프로그램 위치는 `scripts/bin.mjs` 가 운영체제별로 찾는다. 처음 한 번:
|
||||
|
||||
1. 설치: `winget install Git.Git OpenJS.NodeJS.LTS Python.Python.3.12 Gyan.FFmpeg Google.Chrome` (ffmpeg 가 JPEG·webp 변환도 한다). Claude Code 는 네이티브 설치(`claude.exe`), Codex 는 `npm i -g @openai/codex` 후 `codex login`.
|
||||
2. Claude Code 설정(`%USERPROFILE%\.claude\settings.json`)의 `env` 에 `"PYTHON": "python"`, `"PYTHONUTF8": "1"` (스킬의 `${PYTHON:-python3}` 와 파이썬 한글 출력).
|
||||
3. 크롬이 기본 위치(Program Files·LocalAppData)에 없으면 `CHROME_PATH`, claude·codex 를 못 찾는다고 나오면 `CLAUDE_BIN`·`CODEX_BIN` 에 실행 파일 경로.
|
||||
4. `%USERPROFILE%\.ssh\config` 에 맥 `~/.ssh/config` 와 같은 `King_admin`(ProxyJump Confluence)과 키. `ssh -o BatchMode=yes King_admin true` 가 비밀번호 없이 돼야 한다.
|
||||
5. 저장소를 받고 `admin` 에서 `npm install`. 개인 스킬로 쓰려면 `.claude/commands/<이름>.md` 를 `%USERPROFILE%\.claude\skills\<이름>\SKILL.md` 로 복사한다.
|
||||
6. 영상(weekly-ootd-video)은 `~/.config/nalssigak/`(YouTube OAuth 파일)도 옮긴다.
|
||||
|
||||
## 카드 만드는 흐름
|
||||
|
||||
1. **템플릿 고르기**: `tarot`(날씨 타로, 5장) · `ootd`(오늘의 코디, 6장). 코디는 주제·Claude 기획 대신 스타일(캐주얼·세미정장·정장·스트릿·꾸안꾸, copy의 `style`)을 고른다. 지역은 고르지 않는다. 모든 카드는 서울(중구) 오늘 예보로 만들고, 카드에 지역 이름은 넣지 않는다.
|
||||
@@ -35,7 +46,7 @@ VITE_API_BASE_URL=http://localhost:9810 npm run dev # http://localhost:5175
|
||||
|
||||
## 매일 올리기 (슬래시 명령)
|
||||
|
||||
사용자용 안내는 `docs/인스타_카드_사용법.md`. Claude Code에서 `/daily-tarot <주제>`, `/daily-ootd <스타일>`, `/daily-cards <주제> <스타일>` 을 치면 만들기 → 장마다 검수 → 킹서버 피드·인스타 게시 → 링크 보고까지 한 번에 한다. 명령 정의는 `.claude/commands/`.
|
||||
사용자용 안내는 `docs/인스타_운영.md` 1장. Claude Code에서 `/daily-tarot <주제>`, `/daily-ootd <스타일>`, `/daily-cards <주제> <스타일>` 을 치면 만들기 → 장마다 검수 → 킹서버 피드·인스타 게시 → 링크 보고까지 한 번에 한다. 명령 정의는 `.claude/commands/`.
|
||||
|
||||
## 대화로 만들 때 (Claude·Codex)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ done
|
||||
for name in woman_a woman_b man_a man_b; do
|
||||
[ -s "$name.mp4" ] && { echo "$name 이미 있음"; continue; }
|
||||
echo "== $name 시작 $(date +%H:%M:%S)"
|
||||
python3 "$HERE/generate.py" --image "${name%_*}_first.png" --prompt-file "$name.txt" --negative "$negative" \
|
||||
"${PYTHON:-python3}" "$HERE/generate.py" --image "${name%_*}_first.png" --prompt-file "$name.txt" --negative "$negative" \
|
||||
--duration 4 --seed $((RANDOM % 9000 + 100)) --anchor-end --keep-running --output "$name.mp4"
|
||||
echo "== $name 완료 $(date +%H:%M:%S)"
|
||||
done
|
||||
@@ -30,12 +30,12 @@ def main():
|
||||
"",
|
||||
Path(args.prompt_file).read_text(encoding="utf-8").strip(),
|
||||
])
|
||||
command = ["codex", "exec", "--skip-git-repo-check", "-C", str(work), "-s", "workspace-write", "-m", IMAGE_MODEL,
|
||||
command = [os.environ.get("CODEX_BIN") or shutil.which("codex") or "codex", "exec", "--skip-git-repo-check", "-C", str(work), "-s", "workspace-write", "-m", IMAGE_MODEL,
|
||||
"-c", 'model_reasoning_effort="low"']
|
||||
for image in args.image:
|
||||
command += ["-i", str(Path(image).resolve())]
|
||||
try:
|
||||
subprocess.run(command, input=task, text=True, stdout=subprocess.DEVNULL, check=True)
|
||||
subprocess.run(command, input=task, encoding="utf-8", stdout=subprocess.DEVNULL, check=True)
|
||||
result = work / "result.png"
|
||||
if not result.is_file():
|
||||
pngs = sorted(work.glob("*.png"))
|
||||
|
||||
@@ -7,12 +7,14 @@ set -euo pipefail
|
||||
HERE=$(cd "$(dirname "$0")" && pwd)
|
||||
WORK=$(cd "$1" && pwd)
|
||||
MUSIC=${2:-}
|
||||
# 윈도우는 python3 대신 python·py 일 수 있다
|
||||
PY=${PYTHON:-python3}
|
||||
cd "$WORK"
|
||||
[ -s mask.png ] || python3 "$HERE/render.py" mask --out mask.png
|
||||
[ -s frame.png ] || python3 "$HERE/render.py" frame --out frame.png
|
||||
[ -s outro.png ] || python3 "$HERE/render.py" outro --out outro.png
|
||||
[ -s mask.png ] || "$PY" "$HERE/render.py" mask --out mask.png
|
||||
[ -s frame.png ] || "$PY" "$HERE/render.py" frame --out frame.png
|
||||
[ -s outro.png ] || "$PY" "$HERE/render.py" outro --out outro.png
|
||||
part=6.7; outro=2.4; fade=0.4
|
||||
o1=$(python3 -c "print($part - $fade)"); o2=$(python3 -c "print(2 * $part - 2 * $fade)")
|
||||
o1=$(awk "BEGIN{print $part - $fade}"); o2=$(awk "BEGIN{print 2 * $part - 2 * $fade}")
|
||||
card="scale=816:1440:flags=lanczos,format=rgba"
|
||||
blur="scale=272:480,boxblur=10:2,scale=1088:1920,crop=1080:1920:4:0,eq=brightness=0.03:saturation=0.9,format=rgba"
|
||||
join() { # 클립a 클립b 이름
|
||||
@@ -37,11 +39,11 @@ inputs=(); chain=""; prev="0:v"; k=1
|
||||
while read -r name start end; do
|
||||
[ -n "${name:-}" ] || continue
|
||||
inputs+=(-loop 1 -framerate 24 -t 15 -i "bubbles/$name.png")
|
||||
fo=$(python3 -c "print(round($end - 0.2, 2))")
|
||||
fo=$(awk "BEGIN{printf \"%g\", $end - 0.2}")
|
||||
chain+="[$k:v]format=rgba,fade=in:st=$start:d=0.2:alpha=1,fade=out:st=$fo:d=0.2:alpha=1[b$k];"
|
||||
chain+="[$prev][b$k]overlay=x=0:y='max(0\,20*(1-(t-$start)/0.2))':enable='between(t,$start,$end)'[v$k];"
|
||||
prev="v$k"; k=$((k+1))
|
||||
done < bubbles.txt
|
||||
done < <(tr -d '\r' < bubbles.txt)
|
||||
if [ $k -eq 1 ]; then cp base.mp4 bubbles.mp4; else
|
||||
ffmpeg -hide_banner -loglevel error -y -i base.mp4 "${inputs[@]}" -filter_complex "${chain%;}" -map "[$prev]" -map 0:a \
|
||||
-c:v libx264 -preset slow -crf 17 -profile:v high -pix_fmt yuv420p -c:a copy -movflags +faststart bubbles.mp4
|
||||
|
||||
@@ -156,7 +156,7 @@ def main():
|
||||
if side % 64 or not 256 <= side <= 2048:
|
||||
sys.exit("width와 height는 256~2048 사이 64의 배수여야 합니다")
|
||||
|
||||
server = [str(HERE / "server.sh")]
|
||||
server = ["bash", str(HERE / "server.sh")]
|
||||
if subprocess.run(server + ["up"]).returncode != 0:
|
||||
sys.exit("전용 컨테이너를 시작하지 못했습니다")
|
||||
with socket.socket() as sock:
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
"""배경음악을 music.json 에서 무작위로 고른다. 최근 회차(runs/<날짜>-<나이>/publish.md 의 Music 줄)에 쓴 곡은 빼고,
|
||||
캐시(runs/cache/music)에 없으면 내려받는다. 같은 날 여러 나이대를 만들면 편마다 다시 돌려 다른 곡을 쓴다.
|
||||
|
||||
python3 music.py # 출력: <mp3 경로>\t<credit>
|
||||
python3 music.py --recent 6 # 최근 6편에 쓴 곡을 뺀다 (기본 4)
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import random
|
||||
import re
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
CACHE = ROOT / "runs" / "cache" / "music"
|
||||
|
||||
|
||||
def recent_credits(n: int) -> set[str]:
|
||||
runs = sorted((p for p in (ROOT / "runs").glob("*/publish.md") if re.match(r"\d{4}-\d{2}-\d{2}-", p.parent.name)),
|
||||
key=lambda p: (p.parent.name[:10], p.stat().st_mtime), reverse=True)
|
||||
credits = []
|
||||
for p in runs:
|
||||
m = re.search(r"🎵 Music: [^\n]*", p.read_text(encoding="utf-8"))
|
||||
if m:
|
||||
credits.append(m.group(0).strip())
|
||||
return set(credits[:n])
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--recent", type=int, default=4)
|
||||
args = parser.parse_args()
|
||||
|
||||
tracks = json.loads((ROOT / "music.json").read_text(encoding="utf-8"))["tracks"]
|
||||
used = recent_credits(args.recent)
|
||||
pool = [t for t in tracks if t["credit"] not in used] or tracks
|
||||
track = random.SystemRandom().choice(pool)
|
||||
path = CACHE / f"{track['id']}.mp3"
|
||||
if not path.is_file():
|
||||
CACHE.mkdir(parents=True, exist_ok=True)
|
||||
req = urllib.request.Request(track["url"], headers={"User-Agent": "Mozilla/5.0"})
|
||||
with urllib.request.urlopen(req, timeout=60) as res:
|
||||
path.write_bytes(res.read())
|
||||
print(f"{path}\t{track['credit']}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -18,7 +18,20 @@ import urllib.parse
|
||||
from pathlib import Path
|
||||
|
||||
TEMPLATES = Path(__file__).resolve().parent.parent / "templates"
|
||||
CHROME = os.environ.get("CHROME_BIN", "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")
|
||||
def _chrome():
|
||||
env = os.environ.get("CHROME_BIN") or os.environ.get("CHROME_PATH")
|
||||
if env:
|
||||
return env
|
||||
if sys.platform == "win32":
|
||||
for base in (os.environ.get("PROGRAMFILES"), os.environ.get("PROGRAMFILES(X86)"), os.environ.get("LOCALAPPDATA")):
|
||||
path = Path(base or "") / "Google/Chrome/Application/chrome.exe"
|
||||
if base and path.is_file():
|
||||
return str(path)
|
||||
return "chrome.exe"
|
||||
return "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" if sys.platform == "darwin" else "google-chrome"
|
||||
|
||||
|
||||
CHROME = _chrome()
|
||||
# compose.sh 의 영상 창 크기와 같아야 한다
|
||||
CARD = (816, 1440)
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 81 KiB |
@@ -0,0 +1,51 @@
|
||||
// 외부 프로그램(크롬·claude·codex·ffmpeg) 위치와 부르는 법. 맥·윈도우 둘 다에서 돌게 한 곳에 모은다.
|
||||
import { execFileSync } from 'node:child_process'
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { dirname, join } from 'node:path'
|
||||
|
||||
const WIN = process.platform === 'win32'
|
||||
|
||||
export const CHROME =
|
||||
process.env.CHROME_PATH ??
|
||||
(WIN
|
||||
? [`${process.env.PROGRAMFILES}/Google/Chrome/Application/chrome.exe`, `${process.env['PROGRAMFILES(X86)']}/Google/Chrome/Application/chrome.exe`, `${process.env.LOCALAPPDATA}/Google/Chrome/Application/chrome.exe`].find((p) => existsSync(p)) ?? 'chrome.exe'
|
||||
: process.platform === 'darwin'
|
||||
? '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
|
||||
: 'google-chrome')
|
||||
|
||||
/**
|
||||
* execFile 로 부를 [실행 파일, ...앞 인자]. CLAUDE_BIN·CODEX_BIN 환경변수로 바꿀 수 있다.
|
||||
* 윈도우에서 npm 으로 깐 CLI 는 .cmd 라 shell 없이는 못 부르므로(인자 따옴표가 깨짐) .cmd 가 가리키는 .js 를 node 로 직접 부른다.
|
||||
*/
|
||||
export function cli(name) {
|
||||
const override = process.env[`${name.toUpperCase()}_BIN`]
|
||||
if (override) return [override]
|
||||
if (!WIN) return [name]
|
||||
let hits = []
|
||||
try {
|
||||
hits = execFileSync('where', [name], { encoding: 'utf8' }).split(/\r?\n/).filter(Boolean)
|
||||
} catch {
|
||||
throw new Error(`${name} 을(를) 찾지 못했어요. 설치했는지 보고, ${name.toUpperCase()}_BIN 환경변수로 실행 파일 경로를 알려 주세요.`)
|
||||
}
|
||||
const exe = hits.find((p) => p.toLowerCase().endsWith('.exe'))
|
||||
if (exe) return [exe]
|
||||
const shim = hits.find((p) => p.toLowerCase().endsWith('.cmd'))
|
||||
const js = shim && readFileSync(shim, 'utf8').match(/%dp0%\\([^"]+?\.js)/)?.[1]
|
||||
if (!js) throw new Error(`${name} 실행 파일(${hits.join(', ')})을 부를 수 없어요. ${name.toUpperCase()}_BIN 환경변수로 .exe 경로를 알려 주세요.`)
|
||||
return [process.execPath, join(dirname(shim), js)]
|
||||
}
|
||||
|
||||
/** png → jpg (품질 높게) */
|
||||
export function toJpeg(png, jpg) {
|
||||
execFileSync('ffmpeg', ['-y', '-loglevel', 'error', '-i', png, '-q:v', '2', jpg], { stdio: 'ignore' })
|
||||
}
|
||||
|
||||
/** png → webp, 가로 width 로 줄인다. cwebp 가 있으면 쓰고(맥 brew), 없으면 ffmpeg 의 libwebp(윈도우 배포판에 들어 있다) */
|
||||
export function toWebp(png, webp, width = 1024) {
|
||||
try {
|
||||
execFileSync('cwebp', ['-quiet', '-q', '88', '-resize', String(width), '0', png, '-o', webp])
|
||||
} catch (e) {
|
||||
if (e.code !== 'ENOENT') throw e
|
||||
execFileSync('ffmpeg', ['-y', '-loglevel', 'error', '-i', png, '-vf', `scale=${width}:-1`, '-c:v', 'libwebp', '-quality', '88', webp])
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
import { execFileSync } from 'node:child_process'
|
||||
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { CHROME, toJpeg } from './bin.mjs'
|
||||
|
||||
const SLIDES = { tarot: 5, ootd: 4, intro: 8, foliage: 5 }
|
||||
// 기본 문구가 서비스 데이터 그대로라 Claude 기획이 꼭 필요한 템플릿 (src/cards/templates.tsx autoPlan)
|
||||
@@ -16,7 +17,6 @@ const AUTO_PLAN = ['tarot']
|
||||
const THEMES = ['sunset', 'sky', 'mint', 'berry', 'lemon', 'lavender']
|
||||
const ADMIN_URL = process.env.ADMIN_URL ?? 'http://localhost:5175'
|
||||
const API_URL = process.env.VITE_API_BASE_URL ?? 'http://localhost:9810'
|
||||
const CHROME = process.env.CHROME_PATH ?? '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
|
||||
|
||||
function fail(message) {
|
||||
console.error(message)
|
||||
@@ -46,7 +46,7 @@ const [template] = args
|
||||
|
||||
if (!SLIDES[template]) fail(`사용: npm run card -- <${Object.keys(SLIDES).join('|')}> [--topic 주제] [--feedback 피드백] [--color ${THEMES.join('|')}] [--copy 값] [--out 폴더]`)
|
||||
if (color && !THEMES.includes(color)) fail(`색은 ${THEMES.join(', ')} 중 하나예요.`)
|
||||
if (!existsSync(CHROME)) fail(`Chrome을 찾지 못했어요: ${CHROME}\nCHROME_PATH 환경변수로 경로를 알려 주세요.`)
|
||||
if (/[\\/]/.test(CHROME) && !existsSync(CHROME)) fail(`Chrome을 찾지 못했어요: ${CHROME}\nCHROME_PATH 환경변수로 경로를 알려 주세요.`)
|
||||
|
||||
await fetch(`${API_URL}/v1/region/list`).catch((e) => fail(`날씨각 API(${API_URL})에 연결하지 못했어요. 백엔드가 켜져 있는지 확인하세요. (${e.message})`))
|
||||
await fetch(ADMIN_URL).catch(() => fail(`관리자 화면(${ADMIN_URL})이 꺼져 있어요. admin 폴더에서 npm run dev 를 먼저 켜 주세요.`))
|
||||
@@ -128,7 +128,7 @@ for (let slide = 1; slide <= SLIDES[template]; slide++) {
|
||||
if (copy) query.set('copy', copy)
|
||||
const png = resolve(outDir, `${day}_${template}_${slide}.png`)
|
||||
const jpg = png.replace(/\.png$/, '.jpg')
|
||||
execFileSync(CHROME, [
|
||||
const shot = [
|
||||
'--headless=new',
|
||||
'--disable-gpu',
|
||||
'--hide-scrollbars',
|
||||
@@ -137,8 +137,15 @@ for (let slide = 1; slide <= SLIDES[template]; slide++) {
|
||||
'--virtual-time-budget=20000',
|
||||
`--screenshot=${png}`,
|
||||
`${ADMIN_URL}/render?${query}`,
|
||||
], { stdio: 'ignore' })
|
||||
execFileSync('sips', ['-s', 'format', 'jpeg', '-s', 'formatOptions', '92', png, '--out', jpg], { stdio: 'ignore' })
|
||||
]
|
||||
// 크롬이 한 장에서 멈추는 일이 있어 45초 넘으면 끊고 그 장만 한 번 더 찍는다
|
||||
try {
|
||||
execFileSync(CHROME, shot, { stdio: 'ignore', timeout: 45_000 })
|
||||
} catch {
|
||||
console.log(`${slide}번째 장이 45초 넘게 멈춰 다시 찍어요`)
|
||||
execFileSync(CHROME, shot, { stdio: 'ignore', timeout: 45_000 })
|
||||
}
|
||||
toJpeg(png, jpg)
|
||||
rmSync(png)
|
||||
files.push(jpg)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { execFileSync } from 'node:child_process'
|
||||
import { mkdtempSync, readdirSync, rmSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { cli, toWebp } from './bin.mjs'
|
||||
|
||||
// 그림은 이미지 생성 도구가 만들고 Codex 는 도구를 부르고 결과를 저장하는 역할뿐이라 중간 모델·낮은 추론으로 고정한다 (가장 싼 gpt-6-luna 는 결과를 파일로 저장하지 못하고, 기본 설정의 gpt-6-astra·xhigh 는 한도를 금방 소진한다)
|
||||
export const IMAGE_MODEL = process.env.CODEX_IMAGE_MODEL ?? 'gpt-6-sol'
|
||||
@@ -27,7 +28,8 @@ export function drawWithCodex({ id, prompt, outPath, images = [], log = console.
|
||||
try {
|
||||
// -i 는 파일을 여러 개 받아서 뒤의 프롬프트까지 파일로 읽는다 → 프롬프트는 stdin 으로 준다
|
||||
const imageArgs = images.flatMap((p) => ['-i', p])
|
||||
execFileSync('codex', ['exec', '--skip-git-repo-check', '-C', work, '-s', 'workspace-write', '-m', IMAGE_MODEL, '-c', 'model_reasoning_effort="low"', ...imageArgs], { input: task, stdio: ['pipe', 'ignore', 'inherit'] })
|
||||
const [codex, ...pre] = cli('codex')
|
||||
execFileSync(codex, [...pre, 'exec', '--skip-git-repo-check', '-C', work, '-s', 'workspace-write', '-m', IMAGE_MODEL, '-c', 'model_reasoning_effort="low"', ...imageArgs], { input: task, stdio: ['pipe', 'ignore', 'inherit'] })
|
||||
} catch (e) {
|
||||
rmSync(work, { recursive: true, force: true })
|
||||
throw new Error(`${id}: Codex 실행이 실패했어요 (${e.message}). 사용 한도나 로그인을 확인하세요.`)
|
||||
@@ -37,7 +39,7 @@ export function drawWithCodex({ id, prompt, outPath, images = [], log = console.
|
||||
log(`${id}: Codex가 그림을 저장하지 않았어요. 작업 폴더: ${work}`)
|
||||
return 'not-saved'
|
||||
}
|
||||
execFileSync('cwebp', ['-quiet', '-q', '88', '-resize', '1024', '0', join(work, png), '-o', outPath])
|
||||
toWebp(join(work, png), outPath)
|
||||
rmSync(work, { recursive: true, force: true })
|
||||
log(`${id}: ${outPath}`)
|
||||
return 'ok'
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// 고른 스냅(사진 + 입은 상품 목록)에서 카드에 쓸 옷 목록을 Claude CLI로 뽑는다: 자리별 한글 이름표와 그림용 영어 설명.
|
||||
import { execFile } from 'node:child_process'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { cli } from './bin.mjs'
|
||||
|
||||
const SLOT_ORDER = ['top', 'outer', 'bottom', 'shoes', 'bag']
|
||||
const PERSONA_TEXT = { f20: '20-30대 여자', m20: '20-30대 남자', f40: '40대 이상 여자', m40: '40대 이상 남자' }
|
||||
@@ -55,9 +56,12 @@ function buildPrompt(pick, persona, weather) {
|
||||
|
||||
/** @returns {Promise<{ style: string, items: { slot: string, label: string, prompt: string }[] }>} */
|
||||
export function extractOutfit(pick, persona, weather) {
|
||||
const args = ['-p', buildPrompt(pick, persona, weather), '--output-format', 'json', '--json-schema', JSON.stringify(schema), '--tools', 'Read', '--allowedTools', 'Read', '--no-session-persistence', '--model', 'sonnet']
|
||||
// 프롬프트는 길고 여러 줄이라 명령줄(윈도우는 길이 제한) 대신 stdin 으로 준다
|
||||
const prompt = buildPrompt(pick, persona, weather)
|
||||
return new Promise((done, fail) => {
|
||||
execFile('claude', args, { cwd: tmpdir(), timeout: 240_000, maxBuffer: 10 * 1024 * 1024 }, (err, stdout) => {
|
||||
const [claude, ...pre] = cli('claude')
|
||||
const args = [...pre, '-p', '--output-format', 'json', '--json-schema', JSON.stringify(schema), '--tools', 'Read', '--allowedTools', 'Read', '--no-session-persistence', '--model', 'sonnet']
|
||||
const child = execFile(claude, args, { cwd: tmpdir(), timeout: 240_000, maxBuffer: 10 * 1024 * 1024 }, (err, stdout) => {
|
||||
if (err) return fail(new Error(`Claude CLI 실행 실패: ${err.message}. 터미널에서 claude 로그인 상태를 확인하세요.`))
|
||||
let out
|
||||
try {
|
||||
@@ -72,5 +76,6 @@ export function extractOutfit(pick, persona, weather) {
|
||||
items.sort((a, b) => SLOT_ORDER.indexOf(a.slot) - SLOT_ORDER.indexOf(b.slot))
|
||||
done({ style: String(result.style ?? '').trim() || '데일리', items })
|
||||
})
|
||||
child.stdin.end(prompt)
|
||||
})
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { execFile } from 'node:child_process'
|
||||
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { resolve } from 'node:path'
|
||||
import { cli } from './bin.mjs'
|
||||
|
||||
const pngNames = (dir) =>
|
||||
readdirSync(resolve(import.meta.dirname, dir))
|
||||
@@ -146,9 +147,12 @@ function schema(ctx, fixed = {}, topic = '') {
|
||||
|
||||
/** @returns {Promise<{ topic: string, copy: Record<string, string> }>} */
|
||||
export function runPlan(ctx, { topic = '', feedback = '', fixed = {} } = {}) {
|
||||
const args = ['-p', buildPrompt(ctx, { topic, feedback, fixed }), '--output-format', 'json', '--json-schema', JSON.stringify(schema(ctx, fixed, topic)), '--tools', '', '--no-session-persistence', '--model', 'sonnet']
|
||||
// 프롬프트는 길고 여러 줄이라 명령줄(윈도우는 길이 제한) 대신 stdin 으로 준다
|
||||
const prompt = buildPrompt(ctx, { topic, feedback, fixed })
|
||||
return new Promise((done, fail) => {
|
||||
execFile('claude', args, { cwd: tmpdir(), timeout: 180_000, maxBuffer: 10 * 1024 * 1024 }, (err, stdout) => {
|
||||
const [claude, ...pre] = cli('claude')
|
||||
const args = [...pre, '-p', '--output-format', 'json', '--json-schema', JSON.stringify(schema(ctx, fixed, topic)), '--tools', '', '--no-session-persistence', '--model', 'sonnet']
|
||||
const child = execFile(claude, args, { cwd: tmpdir(), timeout: 180_000, maxBuffer: 10 * 1024 * 1024 }, (err, stdout) => {
|
||||
if (err) return fail(new Error(`Claude CLI 실행 실패: ${err.message}. 터미널에서 claude 로그인 상태를 확인하세요.`))
|
||||
let out
|
||||
try {
|
||||
@@ -178,5 +182,6 @@ export function runPlan(ctx, { topic = '', feedback = '', fixed = {} } = {}) {
|
||||
if (isTarot(ctx)) for (const k of ['c1', 'c2', 'c3', 'i1', 'i2', 'i3']) if (result[k]) copy[k] = result[k]
|
||||
done({ topic: finalTopic, copy })
|
||||
})
|
||||
child.stdin.end(prompt)
|
||||
})
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
// 무신사 스냅(공개 API)에서 오늘 날씨에 맞는 인기 코디를 사람별로 하나씩 고른다. 사진·상품 썸네일은 그림 참고용으로만 내려받고 어디에도 올리지 않는다.
|
||||
// 사용(확인용): node scripts/snap.mjs --band mild --out out/2026-10-26/snaps
|
||||
// 그날 분위기 색을 먼저 고르려면 --prefer '오렌지|브라운|카멜' (태그·글·상품명에 그 말이 있는 스냅을 앞에 둔다)
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
|
||||
import { join, resolve } from 'node:path'
|
||||
|
||||
@@ -147,8 +148,9 @@ function fits(snap, band) {
|
||||
return hasTop && hasBottom && slots.has('shoes') && !!snap.image
|
||||
}
|
||||
|
||||
function score(snap, persona) {
|
||||
function score(snap, persona, prefer) {
|
||||
let s = Math.log10(snap.likes + 10)
|
||||
if (prefer && (prefer.test(`${snap.tags.join(' ')} ${snap.text}`) || (snap.goods ?? []).some((g) => prefer.test(g.name)))) s += 3
|
||||
const tagBlob = snap.tags.join(' ')
|
||||
const goods = snap.goods ?? []
|
||||
if (PERSONAS[persona].mature) {
|
||||
@@ -173,7 +175,7 @@ async function download(url, path) {
|
||||
}
|
||||
|
||||
/** 사람별로 스냅 하나씩: { f20: {...snap, files: { image, thumbs[] }}, ... }. style 을 주면 네 사람 모두 그 스타일 태그가 붙은 스냅에서 고른다 */
|
||||
export async function pickSnaps({ band, style, outDir, pages = 2, log = console.log }) {
|
||||
export async function pickSnaps({ band, style, prefer, outDir, pages = 2, log = console.log }) {
|
||||
mkdirSync(outDir, { recursive: true })
|
||||
const rule = BAND[band] ?? BAND.mild
|
||||
const styleTags = STYLE_TAGS[style] ?? []
|
||||
@@ -182,6 +184,7 @@ export async function pickSnaps({ band, style, outDir, pages = 2, log = console.
|
||||
for (const tag of styleTags) add(await listSnaps({ tags: tag }, pages * 3))
|
||||
for (const tag of rule.tags) add(await listSnaps({ tags: tag }, pages))
|
||||
for (const gender of ['WOMEN', 'MEN']) for (const kw of MATURE_KEYWORDS[gender]) add(await listSnaps({ keyword: kw }, 1))
|
||||
for (const kw of prefer ? prefer.source.split('|') : []) add(await listSnaps({ keyword: kw }, 1))
|
||||
const hasStyle = (s) => styleTags.length === 0 || s.tags.some((t) => styleTags.some((st) => t.includes(st)))
|
||||
log(`무신사 스냅 후보 ${pool.size}개 (구간 ${band}${styleTags.length ? ` · 스타일 #${styleTags.join(' #')} ${[...pool.values()].filter(hasStyle).length}개` : ''}). 상품 정보를 받아 거르는 중…`)
|
||||
|
||||
@@ -194,7 +197,7 @@ export async function pickSnaps({ band, style, outDir, pages = 2, log = console.
|
||||
// 스타일 태그가 붙은 스냅을 먼저, 모자라면 나머지 (스타일 태그 없는 스냅은 뒤로)
|
||||
const candidates = [...pool.values()]
|
||||
.filter((s) => s.gender === gender && !used.has(s.id))
|
||||
.sort((a, b) => Number(hasStyle(b)) - Number(hasStyle(a)) || score(b, persona) - score(a, persona))
|
||||
.sort((a, b) => Number(hasStyle(b)) - Number(hasStyle(a)) || score(b, persona, prefer) - score(a, persona, prefer))
|
||||
.slice(0, 60)
|
||||
let best = null
|
||||
for (const c of candidates) {
|
||||
@@ -238,5 +241,6 @@ if (process.argv[1]?.endsWith('snap.mjs')) {
|
||||
const flag = (n) => (args.includes(n) ? args[args.indexOf(n) + 1] : null)
|
||||
const band = flag('--band') ?? 'mild'
|
||||
const outDir = flag('--out') ?? `out/${new Date(Date.now() + 9 * 3600_000).toISOString().slice(0, 10)}/snaps`
|
||||
await pickSnaps({ band, style: flag('--style') ?? undefined, outDir, pages: Number(flag('--pages') ?? 2) })
|
||||
const prefer = flag('--prefer') ? new RegExp(flag('--prefer'), 'i') : undefined
|
||||
await pickSnaps({ band, style: flag('--style') ?? undefined, prefer, outDir, pages: Number(flag('--pages') ?? 2) })
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { AdminLayout } from './pages/AdminLayout'
|
||||
import { CardsPage } from './pages/CardsPage'
|
||||
import { HistoryPage } from './pages/HistoryPage'
|
||||
import { RenderPage } from './pages/RenderPage'
|
||||
import { UsersPage } from './pages/UsersPage'
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
@@ -13,6 +14,7 @@ export default function App() {
|
||||
<Route element={<AdminLayout />}>
|
||||
<Route index element={<CardsPage />} />
|
||||
<Route path="history" element={<HistoryPage />} />
|
||||
<Route path="users" element={<UsersPage />} />
|
||||
<Route path="*" element={<CardsPage />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
|
||||
|
After Width: | Height: | Size: 187 KiB |
|
After Width: | Height: | Size: 210 KiB |
@@ -95,7 +95,8 @@ const ootd: Template = {
|
||||
post: (d, c) => ({
|
||||
title: `오늘의 코디 · ${styleLabel(c.style)}`,
|
||||
caption: `낮 최고 ${d.maxC}도, 20대부터 40대~까지 오늘 입을 옷을 넘겨 보세요`,
|
||||
hashtags: tags(STYLE_TAGS[c.style ?? DEFAULT_STYLE] ?? [], [seasonTag(), '#여자코디', '#남자코디', '#20대코디', '#40대코디'], ['#날씨각', '#오늘의코디', '#OOTD', '#데일리룩', '#코디추천', '#오늘날씨']),
|
||||
// 그날 분위기(할로윈 등) 태그는 copy.tags(띄어쓰기로 구분)로 맨 앞에 붙인다
|
||||
hashtags: tags(c.tags ? c.tags.split(' ') : [], STYLE_TAGS[c.style ?? DEFAULT_STYLE] ?? [], [seasonTag(), '#여자코디', '#남자코디', '#20대코디', '#40대코디'], ['#날씨각', '#오늘의코디', '#OOTD', '#데일리룩', '#코디추천', '#오늘날씨']),
|
||||
}),
|
||||
warnings: (d, c) => {
|
||||
if (dailyOutfits(c)) return []
|
||||
@@ -146,7 +147,8 @@ const tarot: Template = {
|
||||
post: (_d, c) => ({
|
||||
title: `오늘의 ${c.title.replaceAll('\n', ' ').replaceAll('*', '')}`,
|
||||
caption: `Q. ${c.question} 1·2·3 중 한 장을 골라 보세요`,
|
||||
hashtags: tags(SKIN_TAGS[c.skin ?? ''] ?? [], [c.n1, c.n2, c.n3].map((n) => (n ? `#${n.replace(/각$/, '').replace(/\s/g, '')}` : undefined)), ['#날씨각', '#날씨타로', '#타로', '#오늘의타로', '#오늘의운세', '#오늘날씨']),
|
||||
// 대주제 배경(skin)과 태그가 안 맞는 주제(나들이 등)는 copy.tags(띄어쓰기로 구분)로 주제 태그를 바꾼다
|
||||
hashtags: tags(c.tags ? c.tags.split(' ') : (SKIN_TAGS[c.skin ?? ''] ?? []), [c.n1, c.n2, c.n3].map((n) => (n ? `#${n.replace(/각$/, '').replace(/\s/g, '')}` : undefined)), ['#날씨각', '#날씨타로', '#타로', '#오늘의타로', '#오늘의운세', '#오늘날씨']),
|
||||
}),
|
||||
name: '날씨 타로',
|
||||
autoPlan: true,
|
||||
|
||||
@@ -3,6 +3,7 @@ import { NavLink, Outlet } from 'react-router'
|
||||
const NAV = [
|
||||
{ to: '/', label: '인스타 카드', end: true },
|
||||
{ to: '/history', label: '만든 카드', end: false },
|
||||
{ to: '/users', label: '가입자', end: false },
|
||||
]
|
||||
|
||||
export function AdminLayout() {
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { useSearchParams } from 'react-router'
|
||||
import { useTargets } from '../api/targets'
|
||||
import type { Target } from '../api/targets'
|
||||
|
||||
type Provider = 1 | 2 | 3
|
||||
type User = { nickname: string; provider: Provider; points: number; level: number; level_name: string; suspended: boolean; created_at: string; last_active?: string }
|
||||
type Res = { total: number; counts: Record<string, number>; items: User[] }
|
||||
|
||||
const PROVIDER: Record<Provider, { label: string; tone: string }> = {
|
||||
1: { label: '웹 일반', tone: 'bg-rail text-ink-soft' },
|
||||
2: { label: '웹 구글', tone: 'bg-warn-soft text-warn' },
|
||||
3: { label: '토스', tone: 'bg-rust-soft text-rust' },
|
||||
}
|
||||
const DAY = ['일', '월', '화', '수', '목', '금', '토']
|
||||
|
||||
function day(iso: string) {
|
||||
const d = new Date(iso)
|
||||
return `${d.getFullYear() % 100}.${d.getMonth() + 1}.${d.getDate()} ${DAY[d.getDay()]}`
|
||||
}
|
||||
|
||||
/** 가입자 목록: 올릴 곳(로컬·킹서버)마다 가입 경로·레벨·모은 각을 본다 */
|
||||
export function UsersPage() {
|
||||
const { data: targets = [] } = useTargets()
|
||||
const [params, setParams] = useSearchParams()
|
||||
const target = targets.find((t) => t.id === params.get('target')) ?? targets[0]
|
||||
const provider = (Number(params.get('provider')) || 0) as 0 | Provider
|
||||
const set = (next: Record<string, string>) => setParams((p) => {
|
||||
for (const [k, v] of Object.entries(next)) {
|
||||
if (v) p.set(k, v)
|
||||
else p.delete(k)
|
||||
}
|
||||
return p
|
||||
}, { replace: true })
|
||||
|
||||
return (
|
||||
<div className="mx-auto flex max-w-[1440px] flex-col gap-5 px-4 py-5 sm:px-6">
|
||||
<header className="flex flex-wrap items-center justify-between gap-x-6 gap-y-3">
|
||||
<div className="flex min-w-0 flex-col gap-0.5">
|
||||
<h1 className="text-[20px] font-bold tracking-[-0.02em]">가입자</h1>
|
||||
<p className="text-[13px] text-muted">웹(일반·구글)과 토스로 가입한 사람. 마지막 활동은 각을 마지막으로 받은 날이에요.</p>
|
||||
</div>
|
||||
{targets.length > 1 && (
|
||||
<div role="tablist" aria-label="서버" className="flex gap-1 rounded-xl border border-line bg-panel p-1">
|
||||
{targets.map((t) => (
|
||||
<button key={t.id} role="tab" aria-selected={t.id === target?.id} onClick={() => set({ target: t.id })} className={`rounded-lg px-4 py-2 text-[14px] font-bold transition-colors duration-150 ${t.id === target?.id ? 'bg-ink text-white' : 'text-ink-soft hover:bg-rail'}`}>
|
||||
{t.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</header>
|
||||
{target ? <UserList target={target} provider={provider} onProvider={(p) => set({ provider: p ? String(p) : '' })} /> : <p className="rounded-xl border border-bad/30 bg-bad-soft px-5 py-4 text-[14px] text-bad">서버가 없어요. 관리자 서버에 ADMIN_API_KEY(로컬)·KING_ADMIN_API_KEY(킹서버)를 주고 다시 켜 주세요.</p>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function UserList({ target, provider, onProvider }: { target: Target; provider: 0 | Provider; onProvider: (p: 0 | Provider) => void }) {
|
||||
const { data, error, isLoading } = useQuery({
|
||||
queryKey: ['users', target.id],
|
||||
queryFn: async () => {
|
||||
const r = await fetch(`/api/users?target=${target.id}`)
|
||||
const body = await r.json()
|
||||
if (!r.ok || body.result?.success === false) throw new Error(body.error ?? body.result?.desc ?? `HTTP ${r.status}`)
|
||||
return body as Res
|
||||
},
|
||||
})
|
||||
const items = data?.items ?? []
|
||||
const shown = provider ? items.filter((u) => u.provider === provider) : items
|
||||
|
||||
return (
|
||||
<section className="flex flex-col gap-4">
|
||||
<div role="radiogroup" aria-label="가입 경로" className="flex flex-wrap gap-2">
|
||||
{([0, 1, 2, 3] as const).map((p) => (
|
||||
<button key={p} role="radio" aria-checked={provider === p} onClick={() => onProvider(p)} className={`rounded-full border px-3 py-1 text-[12px] font-semibold transition-colors duration-150 ${provider === p ? 'border-ink bg-ink text-white' : 'border-line bg-panel text-ink hover:border-ink-soft'}`}>
|
||||
{p === 0 ? '전체' : PROVIDER[p].label} <span className={provider === p ? 'text-white/70' : 'text-muted'}>{p === 0 ? (data?.total ?? 0) : (data?.counts[p] ?? 0)}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{error && (
|
||||
<div role="alert" className="rounded-xl border border-bad/30 bg-bad-soft px-5 py-4 text-[14px] text-bad">
|
||||
{target.label} 가입자를 받지 못했어요: {error instanceof Error ? error.message : String(error)}
|
||||
</div>
|
||||
)}
|
||||
{isLoading && <div className="h-64 animate-pulse rounded-2xl bg-rail" aria-busy="true" />}
|
||||
{data && shown.length === 0 && <p className="rounded-2xl border border-dashed border-line bg-panel px-5 py-10 text-center text-[14px] text-muted">가입자가 없어요.</p>}
|
||||
{shown.length > 0 && (
|
||||
<div className="overflow-x-auto rounded-2xl border border-line bg-panel">
|
||||
<table className="w-full min-w-[720px] border-collapse text-[14px]">
|
||||
<thead>
|
||||
<tr className="border-b border-line text-left text-[12px] text-muted">
|
||||
<th className="px-4 py-2.5 font-semibold">닉네임</th>
|
||||
<th className="px-4 py-2.5 font-semibold">가입 경로</th>
|
||||
<th className="px-4 py-2.5 font-semibold">레벨</th>
|
||||
<th className="px-4 py-2.5 text-right font-semibold">각</th>
|
||||
<th className="px-4 py-2.5 font-semibold">가입일</th>
|
||||
<th className="px-4 py-2.5 font-semibold">마지막 활동</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{shown.map((u, i) => (
|
||||
<tr key={`${u.created_at}-${i}`} className="border-b border-line/60 last:border-0">
|
||||
<td className="px-4 py-2.5 font-semibold">
|
||||
{u.nickname}
|
||||
{u.suspended && <span className="ml-2 rounded-md bg-bad-soft px-1.5 py-0.5 text-[11px] font-bold text-bad">정지</span>}
|
||||
</td>
|
||||
<td className="px-4 py-2.5"><span className={`rounded-md px-1.5 py-0.5 text-[12px] font-bold ${PROVIDER[u.provider].tone}`}>{PROVIDER[u.provider].label}</span></td>
|
||||
<td className="px-4 py-2.5">Lv.{u.level} <span className="text-ink-soft">{u.level_name}</span></td>
|
||||
<td className="px-4 py-2.5 text-right tabular-nums">{u.points.toLocaleString()}</td>
|
||||
<td className="px-4 py-2.5 tabular-nums text-ink-soft">{day(u.created_at)}</td>
|
||||
<td className="px-4 py-2.5 tabular-nums text-ink-soft">{u.last_active ? day(u.last_active) : '—'}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -155,6 +155,19 @@ function postApi(): Plugin {
|
||||
res.end(JSON.stringify({ error: e instanceof Error ? e.message : String(e) }))
|
||||
}
|
||||
})
|
||||
// 가입자: GET /api/users → GET /v1/admin/users
|
||||
server.middlewares.use('/api/users', async (req, res) => {
|
||||
res.setHeader('Content-Type', 'application/json; charset=utf-8')
|
||||
try {
|
||||
if (req.method !== 'GET') throw new Error('GET /api/users')
|
||||
const t = targetOf(req)
|
||||
return await relay(res, await fetch(`${t.api}/v1/admin/users?limit=2000`, { headers: headers(t) }))
|
||||
} catch (e) {
|
||||
server.config.logger.error(`[users-api] ${e instanceof Error ? e.message : String(e)}`)
|
||||
res.statusCode = 500
|
||||
res.end(JSON.stringify({ error: e instanceof Error ? e.message : String(e) }))
|
||||
}
|
||||
})
|
||||
server.middlewares.use('/api/post', async (req, res) => {
|
||||
res.setHeader('Content-Type', 'application/json; charset=utf-8')
|
||||
try {
|
||||
|
||||
@@ -401,7 +401,9 @@ class Comment(Base):
|
||||
__tablename__ = "comment"
|
||||
|
||||
comment_id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
||||
post_id: Mapped[int] = mapped_column(BigInteger)
|
||||
# 포스트 댓글은 post_id, 사람 글 댓글은 talk_id 하나만 채운다
|
||||
post_id: Mapped[Optional[int]] = mapped_column(BigInteger, nullable=True)
|
||||
talk_id: Mapped[Optional[int]] = mapped_column(BigInteger, nullable=True)
|
||||
user_id: Mapped[Optional[uuid.UUID]] = mapped_column(UUID(as_uuid=True), nullable=True)
|
||||
ip_hash: Mapped[Optional[str]] = mapped_column(String(64), nullable=True)
|
||||
region_name: Mapped[Optional[str]] = mapped_column(String(20), nullable=True)
|
||||
@@ -504,6 +506,7 @@ class Talk(Base):
|
||||
image: Mapped[Optional[str]] = mapped_column(String(200), nullable=True)
|
||||
topic: Mapped[int] = mapped_column(SmallInteger, default=1)
|
||||
like_count: Mapped[int] = mapped_column(Integer, default=0)
|
||||
comment_count: Mapped[int] = mapped_column(Integer, default=0)
|
||||
report_count: Mapped[int] = mapped_column(Integer, default=0)
|
||||
hidden: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
@@ -125,6 +125,12 @@ class TalkTopic(CodeEnum):
|
||||
RAIN = 3 # 비·눈
|
||||
FOLIAGE = 4 # 단풍·꽃
|
||||
OUTFIT = 5 # 오늘 옷차림
|
||||
HALLOWEEN = 6 # 기념일 주제: 그 기간에만 고를 수 있다 (frontend holiday.ts)
|
||||
PEPERO = 7
|
||||
CHRISTMAS = 8
|
||||
CHUSEOK = 9
|
||||
SUNEUNG = 10
|
||||
NEWYEAR = 11
|
||||
|
||||
|
||||
class TalkReport(CodeEnum):
|
||||
|
||||
@@ -6,12 +6,20 @@ from sqlalchemy import delete, func, or_, select, update
|
||||
from sqlalchemy.dialects.postgresql import insert
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from common.database.model.models import Comment, CommentLike, CommentLikeAnon, CommentReport, Post, PostLike, PostLikeAnon, PostSave, User, UserBlock
|
||||
from common.database.model.models import Comment, CommentLike, CommentLikeAnon, CommentReport, Post, PostLike, PostLikeAnon, PostSave, Talk, User, UserBlock
|
||||
from common.liker import Liker
|
||||
|
||||
HIDE_AT = 3 # 신고가 이만큼 쌓이면 모두에게서 숨긴다
|
||||
|
||||
|
||||
async def _count(s: AsyncSession, post_id: Optional[int], talk_id: Optional[int], delta: int) -> None:
|
||||
"""댓글이 달린 곳(사람 글 또는 포스트)의 댓글 수를 고친다."""
|
||||
if talk_id is not None:
|
||||
await s.execute(update(Talk).where(Talk.talk_id == talk_id).values(comment_count=Talk.comment_count + delta))
|
||||
elif post_id is not None:
|
||||
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count + delta))
|
||||
|
||||
|
||||
async def toggle_like_row(s: AsyncSession, who: Liker, member: type, anon: type, id_name: str, id_value: int, on: bool) -> bool:
|
||||
"""로그인했으면 member 표에 user_id 로, 아니면 anon 표에 ip_hash 로 넣거나 지운다. 실제로 바뀌었으면 True."""
|
||||
model, keys = (member, {id_name: id_value, "user_id": who.user_id}) if who.user_id is not None else (anon, {id_name: id_value, "ip_hash": who.ip_hash})
|
||||
@@ -54,10 +62,13 @@ class ReactionCRUD:
|
||||
stmt = stmt.where(Post.post_id < cursor)
|
||||
return list((await s.execute(stmt.order_by(Post.post_id.desc()).limit(limit))).all())
|
||||
|
||||
async def comments(self, s: AsyncSession, post_id: int, viewer: Optional[uuid.UUID], cursor: Optional[int], limit: int) -> list[tuple[Comment, Optional[str], Optional[str], Optional[str], Optional[str]]]:
|
||||
"""로그인 없이 쓴 댓글은 User 칸이 모두 None 이다. 숨긴 댓글은 빼고, 보는 사람이 신고한 댓글·차단한 사람의 댓글도 뺀다."""
|
||||
async def comments(
|
||||
self, s: AsyncSession, post_id: Optional[int], viewer: Optional[uuid.UUID], cursor: Optional[int], limit: int, talk_id: Optional[int] = None,
|
||||
) -> list[tuple[Comment, Optional[str], Optional[str], Optional[str], Optional[str]]]:
|
||||
"""포스트(post_id) 또는 사람 글(talk_id)의 댓글. 로그인 없이 쓴 댓글은 User 칸이 모두 None 이다. 숨긴 댓글은 빼고, 보는 사람이 신고한 댓글·차단한 사람의 댓글도 뺀다."""
|
||||
target = Comment.talk_id == talk_id if talk_id is not None else Comment.post_id == post_id
|
||||
stmt = select(Comment, User.nickname, User.character, User.color, User.mood).outerjoin(User, User.user_id == Comment.user_id).where(
|
||||
Comment.post_id == post_id, Comment.deleted.is_(False), Comment.is_hidden.is_(False)
|
||||
target, Comment.deleted.is_(False), Comment.is_hidden.is_(False)
|
||||
)
|
||||
if viewer is not None:
|
||||
stmt = stmt.where(
|
||||
@@ -76,10 +87,11 @@ class ReactionCRUD:
|
||||
stmt = select(CommentLikeAnon.comment_id).where(CommentLikeAnon.ip_hash == ip_hash, CommentLikeAnon.comment_id.in_(comment_ids))
|
||||
return set((await s.scalars(stmt)).all())
|
||||
|
||||
async def add_comment(self, s: AsyncSession, post_id: int, who: Liker, body: str, region_name: Optional[str]) -> Comment:
|
||||
c = Comment(post_id=post_id, user_id=who.user_id, body=body) if who.user_id is not None else Comment(post_id=post_id, ip_hash=who.ip_hash, region_name=region_name, body=body)
|
||||
async def add_comment(self, s: AsyncSession, post_id: Optional[int], who: Liker, body: str, region_name: Optional[str], talk_id: Optional[int] = None) -> Comment:
|
||||
c = (Comment(post_id=post_id, talk_id=talk_id, user_id=who.user_id, body=body) if who.user_id is not None
|
||||
else Comment(post_id=post_id, talk_id=talk_id, ip_hash=who.ip_hash, region_name=region_name, body=body))
|
||||
s.add(c)
|
||||
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count + 1))
|
||||
await _count(s, post_id, talk_id, 1)
|
||||
await s.flush()
|
||||
return c
|
||||
|
||||
@@ -90,14 +102,14 @@ class ReactionCRUD:
|
||||
owner = Comment.user_id == who.user_id if who.user_id is not None else (Comment.user_id.is_(None) & (Comment.ip_hash == who.ip_hash))
|
||||
res = await s.execute(
|
||||
update(Comment).where(Comment.comment_id == comment_id, owner, Comment.deleted.is_(False))
|
||||
.values(deleted=True).returning(Comment.post_id, Comment.is_hidden)
|
||||
.values(deleted=True).returning(Comment.post_id, Comment.talk_id, Comment.is_hidden)
|
||||
)
|
||||
row = res.first()
|
||||
if row is None:
|
||||
return False
|
||||
# 숨긴 댓글은 이미 댓글 수에서 빠져 있다
|
||||
if not row.is_hidden:
|
||||
await s.execute(update(Post).where(Post.post_id == row.post_id).values(comment_count=Post.comment_count - 1))
|
||||
await _count(s, row.post_id, row.talk_id, -1)
|
||||
return True
|
||||
|
||||
async def toggle_comment_like(self, s: AsyncSession, comment_id: int, who: Liker, on: bool) -> Optional[int]:
|
||||
@@ -120,22 +132,22 @@ class ReactionCRUD:
|
||||
await s.execute(update(Comment).where(Comment.comment_id == comment_id).values(report_count=Comment.report_count + 1))
|
||||
res = await s.execute(
|
||||
update(Comment).where(Comment.comment_id == comment_id, Comment.report_count >= HIDE_AT, Comment.is_hidden.is_(False), Comment.deleted.is_(False))
|
||||
.values(is_hidden=True).returning(Comment.post_id)
|
||||
.values(is_hidden=True).returning(Comment.post_id, Comment.talk_id)
|
||||
)
|
||||
post_id = res.scalar()
|
||||
if post_id is not None:
|
||||
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count - 1))
|
||||
row = res.first()
|
||||
if row is not None:
|
||||
await _count(s, row.post_id, row.talk_id, -1)
|
||||
|
||||
async def set_hidden(self, s: AsyncSession, comment_id: int, hidden: bool) -> bool:
|
||||
"""운영자가 댓글을 숨기거나 되살린다. 실제로 바뀌었을 때만 댓글 수를 고친다."""
|
||||
res = await s.execute(
|
||||
update(Comment).where(Comment.comment_id == comment_id, Comment.is_hidden.is_(not hidden), Comment.deleted.is_(False))
|
||||
.values(is_hidden=hidden).returning(Comment.post_id)
|
||||
.values(is_hidden=hidden).returning(Comment.post_id, Comment.talk_id)
|
||||
)
|
||||
post_id = res.scalar()
|
||||
if post_id is None:
|
||||
row = res.first()
|
||||
if row is None:
|
||||
return False
|
||||
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count + (-1 if hidden else 1)))
|
||||
await _count(s, row.post_id, row.talk_id, -1 if hidden else 1)
|
||||
return True
|
||||
|
||||
async def block(self, s: AsyncSession, user_id: uuid.UUID, blocked_id: uuid.UUID) -> None:
|
||||
|
||||
@@ -3,13 +3,23 @@ from collections import Counter
|
||||
from datetime import datetime, timezone
|
||||
from typing import Optional
|
||||
|
||||
from sqlalchemy import delete, select, update
|
||||
from sqlalchemy import delete, func, select, update
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from common.database.model.models import Comment, CommentLike, CommentReport, Post, PostLike, PostSave, User, UserBlock
|
||||
from common.database.model.models import Comment, CommentLike, CommentReport, PointLog, Post, PostLike, PostSave, Talk, User, UserBlock
|
||||
|
||||
|
||||
class UserCRUD:
|
||||
async def admin_list(self, s: AsyncSession, limit: int) -> list[tuple[User, Optional[datetime]]]:
|
||||
"""가입자 최근 순, 각을 마지막으로 받은 날과 함께 (관리자 목록)"""
|
||||
last = select(PointLog.user_id, func.max(PointLog.day).label("last")).group_by(PointLog.user_id).subquery()
|
||||
rows = await s.execute(select(User, last.c.last).outerjoin(last, last.c.user_id == User.user_id).where(User.deleted.is_(False)).order_by(User.created_at.desc()).limit(limit))
|
||||
return [(u, d) for u, d in rows.all()]
|
||||
|
||||
async def provider_counts(self, s: AsyncSession) -> dict[int, int]:
|
||||
rows = await s.execute(select(User.provider, func.count()).where(User.deleted.is_(False)).group_by(User.provider))
|
||||
return {p: n for p, n in rows.all()}
|
||||
|
||||
async def by_login_id(self, s: AsyncSession, login_id: str) -> Optional[User]:
|
||||
return await s.scalar(select(User).where(User.login_id == login_id, User.deleted.is_(False)))
|
||||
|
||||
@@ -64,12 +74,17 @@ class UserCRUD:
|
||||
if reported:
|
||||
await s.execute(update(Comment).where(Comment.comment_id.in_(reported)).values(report_count=Comment.report_count - 1))
|
||||
await s.execute(delete(UserBlock).where((UserBlock.user_id == user_id) | (UserBlock.blocked_id == user_id)))
|
||||
mine = (await s.execute(delete(Comment).where(Comment.user_id == user_id).returning(Comment.comment_id, Comment.post_id, Comment.deleted, Comment.is_hidden))).all()
|
||||
mine = (await s.execute(
|
||||
delete(Comment).where(Comment.user_id == user_id).returning(Comment.comment_id, Comment.post_id, Comment.talk_id, Comment.deleted, Comment.is_hidden)
|
||||
)).all()
|
||||
if mine:
|
||||
ids = [c for c, _, _, _ in mine]
|
||||
ids = [c for c, *_ in mine]
|
||||
await s.execute(delete(CommentLike).where(CommentLike.comment_id.in_(ids)))
|
||||
await s.execute(delete(CommentReport).where(CommentReport.comment_id.in_(ids)))
|
||||
# 이미 지웠거나 숨긴 댓글은 댓글 수에서 빠져 있다
|
||||
for post_id, n in Counter(p for _, p, deleted, hidden in mine if not deleted and not hidden).items():
|
||||
shown = [(p, t) for _, p, t, deleted, hidden in mine if not deleted and not hidden]
|
||||
for post_id, n in Counter(p for p, t in shown if t is None).items():
|
||||
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count - n))
|
||||
for talk_id, n in Counter(t for _, t in shown if t is not None).items():
|
||||
await s.execute(update(Talk).where(Talk.talk_id == talk_id).values(comment_count=Talk.comment_count - n))
|
||||
await s.execute(delete(User).where(User.user_id == user_id))
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
| 문서 | 내용 | 아티팩트 |
|
||||
|---|---|---|
|
||||
| `../../docs/데이터_흐름.html` | 데이터 흐름: 어디서 받는지와 그 이유, 피드 하나를 열면 무엇을 언제 받아 어디에 두는지, 하루 시계, 화면별 데이터 | https://claude.ai/artifact/CcdToNRntavNvo3XKNokqJ |
|
||||
| `../../docs/서비스_동작_안내.md` | 데이터 흐름: 어디서 받는지와 그 이유, 피드 하나를 열면 무엇을 언제 받아 어디에 두는지, 하루 시각표, 화면별 데이터, 피드·포스트 | https://claude.ai/artifact/CcdToNRntavNvo3XKNokqJ (데이터 흐름 HTML 게시본) |
|
||||
| `각_계산기준.md` | 각별 설정표 (비중·시간대·조건·문장). `scripts/gen_gak_doc.py`가 `seed/index_definition.json`으로 만든다 | - |
|
||||
| `openmeteo-data.md` | Open-Meteo로 받는 구름(JMA·ICON, 20·100km)과 보조값(자외선·가시거리·돌풍·기압·일조·일사·지면온도)의 변수, 3시간 집계, 저장·갱신, 호출량, 지수 활용 후보, DB 적용 SQL | - |
|
||||
| `api.html` | API 목록, 응답 예시, 프론트 연결(Hey API) | https://claude.ai/artifact/LjVYpLzomBTrkMxjDvAoDD |
|
||||
| `index-draft.html` | 활동 지수 기준 초안 (실제 값은 `seed/index_definition.json`) | https://claude.ai/artifact/RrgaKozLCycwduymWPXz4s |
|
||||
|
||||
@@ -70,7 +70,7 @@ td.n{white-space:nowrap;font-weight:600}
|
||||
<tr><td class="n">등산 <span class="core">가을</span></td><td class="w">7~12시</td><td class="w">30·25·20·10·10·5</td><td>범위 10~20° (정상 기준 −6°)</td><td>마를수록</td><td>잔잔 ≤4, 한계 12</td><td>범위</td><td>주말 100, 평일 50</td><td>비 확률 70% 이상, 강풍주의보</td><td>등산로 통제, 낙석</td></tr>
|
||||
<tr><td class="n">세차</td><td class="w">오늘 + 앞으로 이틀</td><td class="w">5·60·10·10·10·5</td><td>범위 5~28°</td><td>마를수록 (이틀 최대)</td><td>잔잔 ≤4, 한계 10</td><td>낮을수록</td><td>낮 100, 밤 40</td><td>이틀 안 비 70% 이상 → 20점 아래</td><td>황사·꽃가루</td></tr>
|
||||
<tr><td class="n">캠핑 <span class="core">가을</span></td><td class="w">18~다음날 8시</td><td class="w">30·25·15·15·10·5</td><td>범위 12~22°</td><td>마를수록</td><td>잔잔 ≤3, 한계 9</td><td>낮을수록 (이슬)</td><td>금·토 100, 평일 60</td><td>비 확률 60% 이상, 강풍</td><td>캠핑장 예약</td></tr>
|
||||
<tr><td class="n">러닝</td><td class="w">6~8시, 19~22시 중 좋은 쪽</td><td class="w">35·20·10·20·10·5</td><td>범위 8~18°</td><td>마를수록</td><td>잔잔 ≤4, 한계 10</td><td>낮을수록</td><td>아침·저녁 100, 늦은 밤 40</td><td>체감 35° 이상, 비 확률 90% 이상</td><td>노면 상태</td></tr>
|
||||
<tr><td class="n">러닝</td><td class="w">6~8시, 19~22시 (지금 순위는 구간별, 하루 점수는 좋은 쪽)</td><td class="w">35·20·10·15·15·5</td><td>범위 5~18°, 최적 12° (5~8°도 좋음)</td><td>마를수록</td><td>잔잔 ≤3, 한계 8</td><td>낮을수록</td><td>활동 시간대와 겹치면 100, 아니면 0 (시간 비중 5%). 현재 구간은 남은 시간만 평가</td><td>0점: 비 소식, 비 확률 70% 이상, 체감 0° 미만·35° 이상, 바람 8m/s 이상, 돌풍 15m/s 이상, 강풍 특보, 초미세먼지 75㎍/㎥ 이상<br>최대 30점: 비 확률 60% 이상, 바람 6m/s 이상, 초미세먼지 36㎍/㎥ 이상, 체감 28° 이상<br>최대 40점: 체감 5° 미만<br>최대 50점: 활동 시간대와 겹치지 않는 구간 (더 낮은 상한 우선)</td><td>노면 상태</td></tr>
|
||||
<tr><td class="n">별보기 <span class="core">가을</span></td><td class="w">21~02시</td><td class="w">5·15·5·10·20·45</td><td>범위 5~25°</td><td>마를수록</td><td>잔잔 ≤5, 한계 12</td><td>낮을수록</td><td>달이 어두울수록 100 (보름 20)</td><td>하늘 흐림(전체 구름) 80% 이상</td><td>도시 불빛 (지역 평균만)</td></tr>
|
||||
<tr><td class="n">짬뽕각 <span class="fun">재미</span></td><td class="w">11~14시, 17~20시</td><td class="w">40·25·15·10·5·5</td><td>낮을수록 (25° 0점 → 5° 100점)</td><td>올수록</td><td>셀수록</td><td>높을수록</td><td>식사 시간 100</td><td>없음</td><td>실제 주문량 검증 전</td></tr>
|
||||
<tr><td class="n">막걸리각 <span class="fun">재미</span></td><td class="w">17~22시</td><td class="w">15·50·10·15·5·5</td><td>낮을수록 (28° 0점 → 10° 100점)</td><td>올수록</td><td>셀수록</td><td>높을수록</td><td>금·토 100, 평일 50</td><td>없음</td><td>실제 판매량 검증 전</td></tr>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 날씨각 호출량·DB 크기 추정
|
||||
|
||||
2026-10-02 기준 코드와 개발 DB 실측으로 계산했다. 동작 방식은 `../../docs/데이터_흐름.html` 참고.
|
||||
2026-10-02 기준 코드와 개발 DB 실측으로 계산했다. 동작 방식은 `../../docs/서비스_동작_안내.md` 1장 참고.
|
||||
|
||||
## 핵심
|
||||
|
||||
|
||||
@@ -259,20 +259,22 @@
|
||||
- 설명: 뛰기 좋은 정도 (아침·저녁 중 좋은 쪽)
|
||||
- 분류: 밖에서 놀기 · 중요도 상 · 아이콘 `running` · 재미 각 아니오 · 계절 핵심 아니오 · 계산 근거 화면 있음
|
||||
- 시간대: 6~8시 / 19~22시
|
||||
- 지금 순위는 구간별 날씨로 계산하며 현재 구간은 남은 시각만 평가합니다. 하루 점수는 활동 시간대 중 좋은 쪽을 씁니다.
|
||||
- 요소별 규칙 (비중):
|
||||
- 기온 35%: 체감 8~18°가 좋음
|
||||
- 기온 35%: 체감 5~18°가 좋음 (최적 12°, 5~8°도 좋은 점수 유지)
|
||||
- 비 20%: 비 안 올수록 좋음
|
||||
- 바람 10%: 잔잔할수록 좋음 (초속 4m까지 괜찮음, 10m면 0점)
|
||||
- 바람 10%: 잔잔할수록 좋음 (초속 3m까지 괜찮음, 8m면 0점)
|
||||
- 습도 15%: 낮을수록 좋음 (90%=0점 → 40%=100점)
|
||||
- 미세먼지 15%: 초미세먼지 낮을수록 좋음
|
||||
- 시간·요일 5%: 고정 100점
|
||||
- 점수 깎이는 조건: 비 소식이 있으면 0점, 체감 35° 이상이면 0점, 비 확률 70% 이상이면 0점
|
||||
- 시간·요일 5%: 활동 시간대와 겹치면 100점, 겹치지 않으면 0점
|
||||
- 점수 깎이는 조건: 비 소식이 있으면 0점, 체감 35° 이상이면 0점, 비 확률 70% 이상이면 0점, 체감 0° 미만이면 0점, 강풍 특보가 있으면 0점, 바람 8m/s 이상이면 0점, 돌풍 15m/s 이상이면 0점, 초미세먼지 75㎍/㎥ 이상이면 0점, 비 확률 60% 이상이면 최대 30점, 바람 6m/s 이상이면 최대 30점, 초미세먼지 36㎍/㎥ 이상이면 최대 30점, 체감 28° 이상이면 최대 30점, 체감 5° 미만이면 최대 40점, 활동 시간대가 아니면 최대 50점
|
||||
- 상한이 겹치면 더 낮은 상한을 우선하도록 0점 → 최대 30점 → 최대 40점 → 최대 50점 순서로 조건을 둡니다. 중기예보 예상 점수에는 비 확률 상한만 적용됩니다.
|
||||
- 반영 못 하는 것: 노면 상태는 반영하지 못해요
|
||||
- 점수 구간별 설명 (상세 창에 나옴):
|
||||
- 0~29점: 체감 35° 넘거나 비가 쏟아져요. 오늘은 러닝머신으로!
|
||||
- 30~59점: 덥거나 눅눅해서 금방 지쳐요. 거리 줄이고 물 꼭!
|
||||
- 0~29점: 밖에서 뛰기엔 날씨가 험해요. 오늘은 러닝머신으로!
|
||||
- 30~59점: 지금은 뛰기 애매해요. 아침·저녁에 짧게 가볍게!
|
||||
- 60~79점: 뛸 만해요! 아침·저녁 중 시원한 쪽 고르기.
|
||||
- 80~100점: 8~18°에 공기 보송, 기록 갱신각 🏃
|
||||
- 80~100점: 선선하고 공기 보송, 기록 갱신각 🏃
|
||||
|
||||
### 별보기각 (`stars`)
|
||||
|
||||
@@ -378,6 +378,11 @@ CREATE INDEX IF NOT EXISTS idx_talk_user_day ON public.talk (user_id, created_at
|
||||
-- 글 주제 (TalkTopic: 1 동네 이야기, 2 하늘·노을, 3 비·눈, 4 단풍·꽃, 5 오늘 옷차림)
|
||||
ALTER TABLE public.talk ADD COLUMN IF NOT EXISTS topic SMALLINT NOT NULL DEFAULT 1;
|
||||
CREATE INDEX IF NOT EXISTS idx_talk_recent ON public.talk (created_at DESC) WHERE deleted = FALSE AND hidden = FALSE;
|
||||
-- 사람 글 댓글은 comment 표를 같이 쓰고 talk_id 로 가른다 (post_id 는 비움). 숨긴 댓글은 댓글 수에서 빠진다
|
||||
ALTER TABLE public.talk ADD COLUMN IF NOT EXISTS comment_count INTEGER NOT NULL DEFAULT 0;
|
||||
ALTER TABLE public.comment ALTER COLUMN post_id DROP NOT NULL;
|
||||
ALTER TABLE public.comment ADD COLUMN IF NOT EXISTS talk_id BIGINT NULL;
|
||||
CREATE INDEX IF NOT EXISTS idx_comment_talk ON public.comment (talk_id, created_at) WHERE deleted = FALSE AND talk_id IS NOT NULL;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.talk_like (
|
||||
talk_id BIGINT NOT NULL,
|
||||
|
||||
@@ -7,6 +7,7 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
from common.cache.redis_client import REDIS
|
||||
from common.database.db_session_manager import DB_SESSION_MNG
|
||||
from common.models.gmodel import Res_WebPacketProtocol
|
||||
from router.v1.admin.users import router as admin_users_router
|
||||
from router.v1.auth.account import router as auth_router
|
||||
from router.v1.card.card import router as card_router
|
||||
from router.v1.reel.reel import router as reel_router
|
||||
@@ -61,6 +62,7 @@ app.include_router(seo_router)
|
||||
app.include_router(card_router)
|
||||
app.include_router(reel_router)
|
||||
app.include_router(shorts_router)
|
||||
app.include_router(admin_users_router)
|
||||
|
||||
|
||||
class Res_Health(Res_WebPacketProtocol):
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
from datetime import date, datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from common.enums import AuthProvider
|
||||
from common.models.gmodel import Res_WebPacketProtocol, WebPacketProtocol
|
||||
|
||||
|
||||
class AdminUser(WebPacketProtocol):
|
||||
nickname: str
|
||||
provider: AuthProvider
|
||||
points: int = Field(description="모은 각 총량")
|
||||
level: int
|
||||
level_name: str
|
||||
suspended: bool
|
||||
created_at: datetime
|
||||
last_active: Optional[date] = Field(None, description="각을 마지막으로 받은 날")
|
||||
|
||||
|
||||
class Res_AdminUsers(Res_WebPacketProtocol):
|
||||
total: int = 0
|
||||
counts: dict[int, int] = Field({}, description="가입 경로(AuthProvider)별 인원")
|
||||
items: list[AdminUser] = []
|
||||
@@ -0,0 +1,31 @@
|
||||
from fastapi import APIRouter, Depends, Query
|
||||
|
||||
from common.auth import require_admin
|
||||
from common.database.db_session_manager import DB_SESSION_MNG
|
||||
from common.enums import AuthProvider, ErrorType
|
||||
from common.models.errors import error_info
|
||||
from common.utils.kma_time import KST
|
||||
from crud.user_crud import UserCRUD
|
||||
from router.v1.admin.protocol import AdminUser, Res_AdminUsers
|
||||
from services.level_service import LEVELS, level_of
|
||||
|
||||
router = APIRouter(prefix="/v1/admin", tags=["admin"])
|
||||
|
||||
_crud = UserCRUD()
|
||||
|
||||
|
||||
@router.get("/users", response_model=Res_AdminUsers, response_model_exclude_none=True, summary="가입자 목록 (관리자). 가입 경로·레벨·각. 아이디·생년월일은 안 준다", dependencies=[Depends(require_admin)])
|
||||
async def list_users(limit: int = Query(500, ge=1, le=2000)) -> Res_AdminUsers:
|
||||
async def run(s):
|
||||
return await _crud.admin_list(s, limit), await _crud.provider_counts(s)
|
||||
|
||||
err, res = await DB_SESSION_MNG.execute_lambda(run)
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return Res_AdminUsers(result=error_info(err))
|
||||
rows, counts = res
|
||||
items = []
|
||||
for u, last in rows:
|
||||
lv = level_of(u.points)
|
||||
items.append(AdminUser(nickname=u.nickname, provider=AuthProvider(u.provider), points=u.points, level=lv, level_name=LEVELS[lv - 1][1],
|
||||
suspended=u.status != 1, created_at=u.created_at.astimezone(KST), last_active=last))
|
||||
return Res_AdminUsers(total=sum(counts.values()), counts=counts, items=items)
|
||||
@@ -21,17 +21,17 @@ def _me(u: User) -> Me:
|
||||
return Me(login_id=u.login_id, nickname=u.nickname, character=u.character, color=u.color, mood=u.mood, provider=AuthProvider(u.provider), terms_agreed=u.terms_agreed_at is not None)
|
||||
|
||||
|
||||
def _auth(err: ErrorType, user, service: AuthService) -> Res_Auth:
|
||||
def _auth(err: ErrorType, user, service: AuthService, is_new: bool = False) -> Res_Auth:
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return Res_Auth(result=error_info(err))
|
||||
access, refresh = service.tokens(user)
|
||||
return Res_Auth(access_token=access, refresh_token=refresh, me=_me(user))
|
||||
return Res_Auth(access_token=access, refresh_token=refresh, me=_me(user), is_new=is_new)
|
||||
|
||||
|
||||
@router.post("/signup", response_model=Res_Auth, response_model_exclude_none=True, summary="회원가입 (아이디 영문 소문자·숫자·_ 4~20자, 비밀번호 8자 이상, 닉네임 2~12자)")
|
||||
async def signup(req: Req_Signup, service: AuthService = Depends()) -> Res_Auth:
|
||||
err, user = await service.signup(req.login_id, req.password, req.nickname.strip())
|
||||
return _auth(err, user, service)
|
||||
return _auth(err, user, service, is_new=True)
|
||||
|
||||
|
||||
@router.post("/login", response_model=Res_Auth, response_model_exclude_none=True, summary="로그인")
|
||||
@@ -42,8 +42,8 @@ async def login(req: Req_Login, service: AuthService = Depends()) -> Res_Auth:
|
||||
|
||||
@router.post("/toss", response_model=Res_Auth, response_model_exclude_none=True, summary="토스 로그인 (앱인토스 TossAuth.login 의 authorizationCode·referrer)")
|
||||
async def toss(req: Req_TossLogin, service: AuthService = Depends()) -> Res_Auth:
|
||||
err, user = await service.toss_login(req.authorization_code, req.referrer)
|
||||
return _auth(err, user, service)
|
||||
err, user, created = await service.toss_login(req.authorization_code, req.referrer)
|
||||
return _auth(err, user, service, is_new=created)
|
||||
|
||||
|
||||
def _check_toss_basic(authorization: Optional[str]) -> None:
|
||||
@@ -68,8 +68,8 @@ async def toss_unlink(req: Req_TossUnlink, authorization: Optional[str] = Header
|
||||
|
||||
@router.post("/google", response_model=Res_Auth, response_model_exclude_none=True, summary="구글 로그인 (처음이면 자동 닉네임으로 가입)")
|
||||
async def google_login(req: Req_Google, service: AuthService = Depends()) -> Res_Auth:
|
||||
err, user = await service.google(req.credential)
|
||||
return _auth(err, user, service)
|
||||
err, user, created = await service.google(req.credential)
|
||||
return _auth(err, user, service, is_new=created)
|
||||
|
||||
|
||||
@router.get("/config", response_model=Res_AuthConfig, response_model_exclude_none=True, summary="로그인 화면 설정 (구글 클라이언트 ID)")
|
||||
|
||||
@@ -55,6 +55,7 @@ class Res_Auth(Res_WebPacketProtocol):
|
||||
access_token: Optional[str] = None
|
||||
refresh_token: Optional[str] = None
|
||||
me: Optional[Me] = None
|
||||
is_new: Optional[bool] = Field(None, description="이번 요청으로 새로 가입한 계정이면 true (GA sign_up)")
|
||||
|
||||
|
||||
class Res_TossUnlink(Res_WebPacketProtocol):
|
||||
|
||||
@@ -183,12 +183,23 @@ class WeatherWhy(WebPacketProtocol):
|
||||
note: str = Field(description="지금 값 (예: 체감 19°, 편한 범위 18~24° 안)")
|
||||
|
||||
|
||||
class TomorrowEvent(WebPacketProtocol):
|
||||
event_id: int
|
||||
name: str
|
||||
place: str
|
||||
icon: str
|
||||
start_date: date
|
||||
end_date: date
|
||||
|
||||
|
||||
class HeroTomorrow(WebPacketProtocol):
|
||||
"""히어로 '내일' 스위치. 3시간 칸 날씨는 /v1/weather/today?day=tomorrow 로 따로 받는다."""
|
||||
"""히어로 '내일' 스위치와 내일 페이지(/tomorrow/...). 3시간 칸 날씨는 /v1/weather/today?day=tomorrow 로 따로 받는다."""
|
||||
day: date
|
||||
weather_slots: dict[str, int] = Field(default_factory=dict, description="내일 구간별 날씨 점수 {morning·day·evening·night: 점수}")
|
||||
weather_why: dict[str, list[WeatherWhy]] = Field(default_factory=dict, description="내일 구간별 날씨 점수 근거")
|
||||
top1: Optional[TopIndex] = Field(default=None, description="내일 하루 점수로 1위인 각. score·summary 는 내일 값")
|
||||
ranked: list[TopIndex] = Field(default_factory=list, description="내일 하루 점수 순위 5개 (내일 페이지 '내일의 각'). top1 이 첫째")
|
||||
events: list[TomorrowEvent] = Field(default_factory=list, description="내일 열리는 같은 시도 근처 행사 최대 3개 (내일 페이지)")
|
||||
|
||||
|
||||
class Hero(WebPacketProtocol):
|
||||
|
||||
@@ -24,6 +24,12 @@ def _comment(v: CommentView) -> CommentData:
|
||||
return CommentData(comment_id=c.comment_id, nickname=v.nickname, character=v.character, color=v.color, mood=v.mood, body=c.body, like_count=c.like_count, liked=v.liked, mine=v.mine, official=v.official, created_at=c.created_at.astimezone(KST))
|
||||
|
||||
|
||||
def _comment_list(err: ErrorType, items: list[CommentView]) -> Res_CommentList:
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return Res_CommentList(result=error_info(err))
|
||||
return Res_CommentList(comments=[_comment(v) for v in items], next_cursor=items[-1].comment.comment_id if len(items) == PAGE else None)
|
||||
|
||||
|
||||
async def _like(post_id: int, who: Liker, on: bool, service: ReactionService) -> Res_PostLike:
|
||||
err, count = await service.like_post(post_id, who, on)
|
||||
return Res_PostLike(result=error_info(err)) if err is not ErrorType.SUCCESS else Res_PostLike(liked=on, like_count=count)
|
||||
@@ -65,10 +71,7 @@ async def list_comments(
|
||||
post_id: int = Path(...), cursor: Optional[int] = Query(None), user: Optional[User] = Depends(optional_user), who: Liker = Depends(liker),
|
||||
service: ReactionService = Depends(),
|
||||
) -> Res_CommentList:
|
||||
err, items = await service.comments(post_id, user, who.ip_hash, cursor)
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return Res_CommentList(result=error_info(err))
|
||||
return Res_CommentList(comments=[_comment(v) for v in items], next_cursor=items[-1].comment.comment_id if len(items) == PAGE else None)
|
||||
return _comment_list(*await service.comments(post_id, user, who.ip_hash, cursor))
|
||||
|
||||
|
||||
@router.post("/post/{post_id}/comment", response_model=Res_Comment, response_model_exclude_none=True, summary="댓글 쓰기 (60자, 로그인 없으면 '동네 익명'으로 IP 당 하루 20개, 로그인했는데 이용약관 동의 전이면 TERMS_REQUIRED)")
|
||||
@@ -79,6 +82,22 @@ async def add_comment(
|
||||
return Res_Comment(result=error_info(err)) if err is not ErrorType.SUCCESS else Res_Comment(comment=_comment(v))
|
||||
|
||||
|
||||
@router.get("/talk/{talk_id}/comment/list", response_model=Res_CommentList, response_model_exclude_none=True, summary="사람 글 댓글 목록 (로그인 없이 보기)")
|
||||
async def list_talk_comments(
|
||||
talk_id: int = Path(...), cursor: Optional[int] = Query(None), user: Optional[User] = Depends(optional_user), who: Liker = Depends(liker),
|
||||
service: ReactionService = Depends(),
|
||||
) -> Res_CommentList:
|
||||
return _comment_list(*await service.comments(None, user, who.ip_hash, cursor, talk_id))
|
||||
|
||||
|
||||
@router.post("/talk/{talk_id}/comment", response_model=Res_Comment, response_model_exclude_none=True, summary="사람 글 댓글 쓰기 (로그인한 사람만, 60자, 링크·전화번호 불가, 이용약관 동의 전이면 TERMS_REQUIRED). 지우기·좋아요·신고·차단은 /comment/{comment_id} 그대로")
|
||||
async def add_talk_comment(
|
||||
talk_id: int = Path(...), req: Req_Comment = ..., user: User = Depends(current_user), who: Liker = Depends(liker), service: ReactionService = Depends(),
|
||||
) -> Res_Comment:
|
||||
err, v = await service.add_talk_comment(talk_id, user, who, req.body)
|
||||
return Res_Comment(result=error_info(err)) if err is not ErrorType.SUCCESS else Res_Comment(comment=_comment(v))
|
||||
|
||||
|
||||
@router.delete("/comment/{comment_id}", response_model=Res_WebPacketProtocol, response_model_exclude_none=True, summary="내 댓글 지우기 (로그인 없이 쓴 댓글은 같은 IP 에서)")
|
||||
async def delete_comment(comment_id: int = Path(...), who: Liker = Depends(liker), service: ReactionService = Depends()) -> Res_WebPacketProtocol:
|
||||
return Res_WebPacketProtocol(result=error_info(await service.delete_comment(comment_id, who)))
|
||||
|
||||
@@ -37,6 +37,8 @@ class SajuPillar(WebPacketProtocol):
|
||||
branch_ko: str
|
||||
stem_element: str = Field(description="木火土金水")
|
||||
branch_element: str
|
||||
stem_ten_god: Optional[str] = Field(None, description="천간 십성 (일간은 없음)")
|
||||
branch_ten_god: str = Field(description="지지 십성 (정기 기준)")
|
||||
|
||||
|
||||
class SajuMe(WebPacketProtocol):
|
||||
@@ -49,6 +51,11 @@ class SajuMe(WebPacketProtocol):
|
||||
season: Optional[str] = None
|
||||
climate: Optional[str] = Field(None, description="따뜻·마름 / 따뜻·촉촉 / 서늘·마름 / 서늘·촉촉")
|
||||
need: list[str] = Field([], description="내 기운에 필요한 것 (따뜻함·마른 공기 등)")
|
||||
elements: dict[str, float] = Field({}, description="오행 세력 점수 木火土金水 (월지 30·일지 20·나머지 10, 지지는 지장간 날 수로 나눔)")
|
||||
top_element: Optional[str] = Field(None, description="가장 센 오행")
|
||||
strong: Optional[bool] = Field(None, description="신강이면 true, 신약이면 false")
|
||||
strength: Optional[str] = Field(None, description="신강 · 중화 · 신약 (득령이면 돕는 몫에 가산, 45~55% 사이는 중화)")
|
||||
support: Optional[float] = Field(None, description="일간을 뺀 점수 중 일간을 돕는 기운 몫 0~1")
|
||||
|
||||
|
||||
class SajuCard(WebPacketProtocol):
|
||||
|
||||
@@ -11,6 +11,8 @@ from router.v1.saju.protocol import Req_Saju, Req_SajuBirth, Req_SajuMatch, Res_
|
||||
from services import saju_text as T
|
||||
from services.level_service import UNLOCKS
|
||||
from services.saju.ganji import branch_element, ko, stem_element
|
||||
from services.saju.rules import chart_ten_gods
|
||||
from services.saju.strength import chart_strength
|
||||
from services.saju_service import Reading, SajuService, shown_saju, weather_points
|
||||
|
||||
router = APIRouter(prefix="/v1/saju", tags=["saju"])
|
||||
@@ -20,12 +22,16 @@ _WEEKDAY = "월화수목금토일"
|
||||
def _res(r: Reading) -> Res_Saju:
|
||||
c = r.chart
|
||||
pillars = [("year", c.year), ("month", c.month), ("day", c.day)] + ([("hour", c.hour)] if c.hour else [])
|
||||
gods = chart_ten_gods(c.day_stem, dict(pillars))
|
||||
strength = chart_strength(c)
|
||||
today = r.today
|
||||
best = max(r.week, key=lambda d: d.score).day if r.week else None
|
||||
return Res_Saju(
|
||||
me=SajuMe(
|
||||
pillars=[SajuPillar(position=pos, stem=p.stem, branch=p.branch, stem_ko=ko(p.stem), branch_ko=ko(p.branch), stem_element=stem_element(p.stem), branch_element=branch_element(p.branch)) for pos, p in pillars],
|
||||
pillars=[SajuPillar(position=pos, stem=p.stem, branch=p.branch, stem_ko=ko(p.stem), branch_ko=ko(p.branch), stem_element=stem_element(p.stem), branch_element=branch_element(p.branch),
|
||||
stem_ten_god=gods[pos]["stem"], branch_ten_god=gods[pos]["branch"]) for pos, p in pillars],
|
||||
hour_known=c.hour is not None, jeol_warning=c.jeol_on_birth_day, scene=r.scene[0], scene_desc=r.scene[1], scene_icon=r.scene_icon, need=r.need,
|
||||
elements=strength.elements, top_element=strength.top, strong=strength.strong, strength=strength.label, support=strength.support,
|
||||
),
|
||||
today=SajuToday(
|
||||
day=today.day, pillar=ko(today.facts.pillar.stem + today.facts.pillar.branch), ten_god=today.facts.stem_ten_god, title=T.TEN_GOD_TEXT[today.facts.stem_ten_god][0],
|
||||
|
||||
@@ -42,3 +42,19 @@ class Res_ArticleList(Res_WebPacketProtocol):
|
||||
class Res_Article(Res_WebPacketProtocol):
|
||||
article: Optional[ArticleSummary] = None
|
||||
body: list[str] = []
|
||||
|
||||
|
||||
class FirstSnowSpot(WebPacketProtocol):
|
||||
name: str
|
||||
region: str # 시·도
|
||||
lat: float
|
||||
lon: float
|
||||
normal: str # 평년 첫눈 날짜 "MM-DD" (1991~2020 평균)
|
||||
top: bool = False # 처음 화면에 이름까지 보이는 대표 지점
|
||||
snow_date: Optional[date] = None # 앞으로 7일 안에 눈 예보가 있는 첫 날. 없으면 비움
|
||||
snow_cm: Optional[float] = None # 그날 눈 오는 양(cm)
|
||||
|
||||
|
||||
class Res_FirstSnow(Res_WebPacketProtocol):
|
||||
forecast: bool = False # 눈 예보를 받았는지. False 면 snow_date 는 모두 비어 있다(평년 날짜만)
|
||||
spots: list[FirstSnowSpot] = []
|
||||
@@ -5,7 +5,9 @@ from fastapi import APIRouter, Depends, Path, Query
|
||||
from common.database.model.models import Article
|
||||
from common.enums import ArticleCategory, ErrorType
|
||||
from common.models.errors import error_info
|
||||
from router.v1.season.protocol import ArticleSummary, Res_Article, Res_ArticleList, Res_SeasonWeek, TermData
|
||||
from common.utils.kma_time import now_kst
|
||||
from router.v1.season.protocol import ArticleSummary, FirstSnowSpot, Res_Article, Res_ArticleList, Res_FirstSnow, Res_SeasonWeek, TermData
|
||||
from services.first_snow_service import FirstSnowService
|
||||
from services.season_service import SeasonService
|
||||
|
||||
router = APIRouter(prefix="/v1/season", tags=["season"])
|
||||
@@ -44,3 +46,9 @@ async def get_article(article_id: int = Path(...), service: SeasonService = Depe
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return Res_Article(result=error_info(err))
|
||||
return Res_Article(article=_summary(a), body=a.body)
|
||||
|
||||
|
||||
@router.get("/first-snow", response_model=Res_FirstSnow, response_model_exclude_none=True, summary="첫눈 지도: 지점별 평년 첫눈 날짜와 앞으로 7일 눈 예보")
|
||||
async def get_first_snow(service: FirstSnowService = Depends()) -> Res_FirstSnow:
|
||||
forecast, spots = await service.spots(now_kst())
|
||||
return Res_FirstSnow(forecast=forecast, spots=[FirstSnowSpot(**s.__dict__) for s in spots])
|
||||
@@ -19,6 +19,7 @@ class TalkData(WebPacketProtocol):
|
||||
image: Optional[str] = Field(None, description="올린 사진 주소")
|
||||
topic: TalkTopic = TalkTopic.LOCAL
|
||||
like_count: int
|
||||
comment_count: int = 0
|
||||
liked: bool
|
||||
mine: bool
|
||||
created_at: datetime
|
||||
|
||||
@@ -23,7 +23,7 @@ def _data(v: TalkView) -> TalkData:
|
||||
t, u = v.talk, v.author
|
||||
return TalkData(
|
||||
talk_id=t.talk_id, nickname=u.nickname, character=u.character, color=u.color, mood=u.mood, region_name=v.region_name, weather=t.weather,
|
||||
body=t.body, image=t.image, topic=TalkTopic(t.topic), like_count=t.like_count, liked=v.liked, mine=v.mine, created_at=t.created_at.astimezone(KST),
|
||||
body=t.body, image=t.image, topic=TalkTopic(t.topic), like_count=t.like_count, comment_count=t.comment_count, liked=v.liked, mine=v.mine, created_at=t.created_at.astimezone(KST),
|
||||
ago=ago_text(t.created_at, now_kst()),
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ sys.path.insert(0, ROOT)
|
||||
from services.calc.index_calc import _cond # noqa: E402
|
||||
|
||||
SEED = os.path.join(ROOT, "seed", "index_definition.json")
|
||||
OUT = os.path.join(os.path.dirname(ROOT), "docs", "각_계산기준.md")
|
||||
OUT = os.path.join(ROOT, "docs", "각_계산기준.md")
|
||||
|
||||
CAT = {1: "밖에서 놀기", 2: "먹고 마시기", 3: "집안일", 4: "생활 고민"}
|
||||
PRIO = {1: "상", 2: "중", 3: "하"}
|
||||
|
||||
@@ -717,16 +717,17 @@
|
||||
"factor_rules": {
|
||||
"temp": {
|
||||
"type": "range",
|
||||
"lo": 8,
|
||||
"hi": 18
|
||||
"lo": 5,
|
||||
"hi": 18,
|
||||
"best": 12
|
||||
},
|
||||
"rain": {
|
||||
"dir": "dry"
|
||||
},
|
||||
"wind": {
|
||||
"type": "calm",
|
||||
"ok": 4,
|
||||
"limit": 10
|
||||
"ok": 3,
|
||||
"limit": 8
|
||||
},
|
||||
"humidity": {
|
||||
"type": "lower"
|
||||
@@ -751,14 +752,75 @@
|
||||
"field": "rain_prob",
|
||||
"op": ">=",
|
||||
"value": 70
|
||||
},
|
||||
{
|
||||
"field": "feels_c",
|
||||
"op": "<",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"field": "warning",
|
||||
"op": "==",
|
||||
"value": "wind"
|
||||
},
|
||||
{
|
||||
"field": "wind_ms",
|
||||
"op": ">=",
|
||||
"value": 8
|
||||
},
|
||||
{
|
||||
"field": "gust_ms",
|
||||
"op": ">=",
|
||||
"value": 15
|
||||
},
|
||||
{
|
||||
"field": "pm25",
|
||||
"op": ">=",
|
||||
"value": 75
|
||||
},
|
||||
{
|
||||
"field": "rain_prob",
|
||||
"op": ">=",
|
||||
"value": 60,
|
||||
"cap": 30
|
||||
},
|
||||
{
|
||||
"field": "wind_ms",
|
||||
"op": ">=",
|
||||
"value": 6,
|
||||
"cap": 30
|
||||
},
|
||||
{
|
||||
"field": "pm25",
|
||||
"op": ">=",
|
||||
"value": 36,
|
||||
"cap": 30
|
||||
},
|
||||
{
|
||||
"field": "feels_c",
|
||||
"op": ">=",
|
||||
"value": 28,
|
||||
"cap": 30
|
||||
},
|
||||
{
|
||||
"field": "feels_c",
|
||||
"op": "<",
|
||||
"value": 5,
|
||||
"cap": 40
|
||||
},
|
||||
{
|
||||
"field": "time_matches",
|
||||
"op": "==",
|
||||
"value": false,
|
||||
"cap": 50
|
||||
}
|
||||
],
|
||||
"limit_description": "노면 상태는 반영하지 못해요",
|
||||
"sentences": {
|
||||
"0": "체감 35° 넘거나 비가 쏟아져요. 오늘은 러닝머신으로!",
|
||||
"30": "덥거나 눅눅해서 금방 지쳐요. 거리 줄이고 물 꼭!",
|
||||
"0": "밖에서 뛰기엔 날씨가 험해요. 오늘은 러닝머신으로!",
|
||||
"30": "지금은 뛰기 애매해요. 아침·저녁에 짧게 가볍게!",
|
||||
"60": "뛸 만해요! 아침·저녁 중 시원한 쪽 고르기.",
|
||||
"80": "8~18°에 공기 보송, 기록 갱신각 🏃"
|
||||
"80": "선선하고 공기 보송, 기록 갱신각 🏃"
|
||||
},
|
||||
"sort_order": 9,
|
||||
"priority": 1,
|
||||
|
||||
@@ -61,19 +61,20 @@ class AuthService:
|
||||
return ErrorType.AUTH_FAILED, None
|
||||
return ErrorType.SUCCESS, user
|
||||
|
||||
async def toss_login(self, authorization_code: str, referrer: str) -> tuple[ErrorType, Optional[User]]:
|
||||
"""토스 userKey 로 계정을 찾고, 없으면 만든다. 이름·전화번호 같은 개인정보는 받지 않는다."""
|
||||
async def toss_login(self, authorization_code: str, referrer: str) -> tuple[ErrorType, Optional[User], bool]:
|
||||
"""토스 userKey 로 계정을 찾고, 없으면 만든다(셋째 값 True = 이번에 가입). 이름·전화번호 같은 개인정보는 받지 않는다."""
|
||||
if not authorization_code or referrer not in TOSS_REFERRERS:
|
||||
return ErrorType.INVALID_INPUT, None
|
||||
return ErrorType.INVALID_INPUT, None, False
|
||||
try:
|
||||
key = str(await toss_login.user_key(authorization_code, referrer))
|
||||
except toss_login.TossLoginError as e:
|
||||
LOG.error(f"[auth] toss login: {e}")
|
||||
return ErrorType.AUTH_FAILED, None
|
||||
return ErrorType.AUTH_FAILED, None, False
|
||||
provider = AuthProvider.TOSS.value
|
||||
err, user = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.by_provider_uid(s, provider, key))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return err, None
|
||||
return err, None, False
|
||||
created = user is None
|
||||
if user is None:
|
||||
err, user = await DB_SESSION_MNG.execute_lambda_write(
|
||||
lambda s: self.crud.create_social(s, provider, key, f"toss_{key}", f"토스{key[-4:]}")
|
||||
@@ -82,30 +83,33 @@ class AuthService:
|
||||
# 같은 사람이 동시에 두 번 들어온 경우 먼저 만든 계정을 쓴다
|
||||
err, user = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.by_provider_uid(s, provider, key))
|
||||
if err is not ErrorType.SUCCESS or user is None:
|
||||
return err if err is not ErrorType.SUCCESS else ErrorType.DB_ERROR, None
|
||||
return err if err is not ErrorType.SUCCESS else ErrorType.DB_ERROR, None, False
|
||||
created = False
|
||||
if user.status != 1:
|
||||
return ErrorType.AUTH_FAILED, None
|
||||
return ErrorType.SUCCESS, user
|
||||
return ErrorType.AUTH_FAILED, None, False
|
||||
return ErrorType.SUCCESS, user, created
|
||||
|
||||
async def google(self, credential: str) -> tuple[ErrorType, Optional[User]]:
|
||||
"""구글 ID 토큰으로 로그인. 처음이면 자동 닉네임으로 계정을 만든다. 구글 이름·이메일은 저장하지 않는다."""
|
||||
async def google(self, credential: str) -> tuple[ErrorType, Optional[User], bool]:
|
||||
"""구글 ID 토큰으로 로그인. 처음이면 자동 닉네임으로 계정을 만든다(셋째 값 True = 이번에 가입). 구글 이름·이메일은 저장하지 않는다."""
|
||||
sub = await verify_google(credential)
|
||||
if sub is None:
|
||||
return ErrorType.AUTH_FAILED, None
|
||||
return ErrorType.AUTH_FAILED, None, False
|
||||
login_id = f"google_{sub}"
|
||||
err, user = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.by_login_id(s, login_id))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return err, None
|
||||
return err, None, False
|
||||
created = user is None
|
||||
if user is None:
|
||||
err, user = await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.create_google(s, sub, auto_nickname()))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
# 같은 계정이 동시에 처음 들어온 경우엔 먼저 만들어진 쪽을 쓴다
|
||||
err, user = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.by_login_id(s, login_id))
|
||||
if err is not ErrorType.SUCCESS or user is None:
|
||||
return ErrorType.DB_ERROR, None
|
||||
return ErrorType.DB_ERROR, None, False
|
||||
created = False
|
||||
if user.status != 1:
|
||||
return ErrorType.AUTH_FAILED, None
|
||||
return ErrorType.SUCCESS, user
|
||||
return ErrorType.AUTH_FAILED, None, False
|
||||
return ErrorType.SUCCESS, user, created
|
||||
|
||||
async def toss_unlink(self, user_key: str) -> ErrorType:
|
||||
"""토스에서 연결을 끊으면 그 계정의 모든 토큰을 무효로 만든다. 계정이 없어도 성공으로 본다."""
|
||||
|
||||
@@ -270,6 +270,8 @@ def _cond(r: dict) -> tuple[str, str, str]:
|
||||
return "비 소식이 있어", "비 소식이 있거나", "비 소식이 있으면"
|
||||
if r["field"] == "rain_before":
|
||||
return "앞서 내린 비가 없어", "앞서 내린 비가 없거나", "앞서 내린 비가 없으면"
|
||||
if r["field"] == "time_matches":
|
||||
return "활동 시간대가 아니라", "활동 시간대가 아니거나", "활동 시간대가 아니면"
|
||||
base = f"{_FIELD_TEXT[r['field']]} {r['value']}{_UNIT[r['field']]} {'이상' if r['op'] == '>=' else '미만'}"
|
||||
return f"{base}이라", f"{base}이거나", f"{base}이면"
|
||||
|
||||
@@ -293,7 +295,11 @@ _SKY_WORD = {Sky.CLEAR: "맑음", Sky.PARTLY: "구름 많음", Sky.CLOUDY: "흐
|
||||
|
||||
|
||||
def _summary(hours: list[Hour]) -> str:
|
||||
mid = hours[len(hours) // 2]
|
||||
return summary_line(hours[len(hours) // 2])
|
||||
|
||||
|
||||
def summary_line(mid: Hour) -> str:
|
||||
"""그 시각 날씨 한 줄 (오후 5시 13°, 비 60%)."""
|
||||
wind = mid.wind_ms
|
||||
tag = f"비 {mid.rain_prob}%" if mid.rain_prob >= 50 else (
|
||||
"바람 살랑" if wind is not None and wind <= 2 else "바람 조금" if wind is not None and wind <= 5 else "바람 강함" if wind is not None else _SKY_WORD[mid.sky]
|
||||
@@ -358,6 +364,7 @@ def evaluate(definition, windows: list[list[Hour]], ctx: Context) -> Optional[Re
|
||||
"snow": "yes" if any(h.rain_type in (RainType.SNOW, RainType.SLEET) for h in hours) else "no",
|
||||
"rain": "yes" if raining else "no", "humidity": round(mean(h.humidity for h in hours)),
|
||||
"rain_before": "yes" if any(h < hours[0].hour for h in ctx.rain_hours) else "no",
|
||||
"time_matches": ctx.time_matches,
|
||||
}
|
||||
reason, cap = _zero(definition.zero_rules, agg)
|
||||
if reason is not None:
|
||||
@@ -426,7 +433,6 @@ _OUTING_WEIGHTS = {"temp": 35, "rain": 40, "sky": 15, "wind": 10}
|
||||
# 만점 조건을 엄격하게: 기온은 최적 21° ±0.5°, 바람은 초속 1m 이하(ok/2)여야 100점 — 같은 예보를 받는 여러 지역이 한꺼번에 100점이 되던 것을 줄인다
|
||||
_OUTING_RULES = {"temp": {"type": "range", "lo": 17, "hi": 24, "best": 21, "plateau": 0.5}, "rain": {"dir": "dry"}, "wind": {"type": "calm", "ok": 2, "limit": 12}}
|
||||
_OUTING_SKY = {Sky.CLEAR: 100, Sky.PARTLY: 80, Sky.CLOUDY: 50}
|
||||
_OUTING_RAIN_PROB, _OUTING_RAIN_CAP = 60, 30
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -435,7 +441,6 @@ class Outing:
|
||||
factors: dict[str, int]
|
||||
notes: dict[str, str]
|
||||
reason: str # 순위 옆 한 줄 근거 ("비 10% · 체감 21° · 맑음")
|
||||
capped: bool # 비 때문에 최대 30점으로 묶였는지
|
||||
estimated: bool = False
|
||||
|
||||
|
||||
@@ -444,12 +449,8 @@ def _outing(scored: dict[str, tuple[int, str]], prob: int, raining: bool, temp_w
|
||||
notes = {a: n for a, (_, n) in scored.items()}
|
||||
worst = min(factors.values())
|
||||
score = round(sum(factors[a] * w for a, w in _OUTING_WEIGHTS.items()) / 100 * (1 - _WORST_PULL + _WORST_PULL * worst / 100))
|
||||
capped = raining or prob >= _OUTING_RAIN_PROB
|
||||
if capped:
|
||||
score = min(score, _OUTING_RAIN_CAP)
|
||||
notes["rain"] += f", 비 확률 {_OUTING_RAIN_PROB}% 이상이거나 비 소식이면 최대 {_OUTING_RAIN_CAP}점"
|
||||
reason = " · ".join(["비 소식" if raining else f"비 {prob}%", temp_word, _SKY_WORD[sky]])
|
||||
return Outing(score=score, factors=factors, notes=notes, reason=reason, capped=capped, estimated=estimated)
|
||||
return Outing(score=score, factors=factors, notes=notes, reason=reason, estimated=estimated)
|
||||
|
||||
|
||||
def outing(hours: list[Hour]) -> Optional[Outing]:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"about": "나들이 점수 바꾸기 표: 원래 점수 0~100 → 표시 점수. 평균 60·표준편차 15. scripts/gen_outing_score_table.py 가 만든다",
|
||||
"period": [
|
||||
"2025-10-22",
|
||||
"2026-10-21"
|
||||
"2025-11-12",
|
||||
"2026-11-11"
|
||||
],
|
||||
"regions": 32,
|
||||
"samples": 11680,
|
||||
@@ -20,14 +20,13 @@
|
||||
13,
|
||||
17,
|
||||
22,
|
||||
25,
|
||||
28,
|
||||
30,
|
||||
32,
|
||||
34,
|
||||
26,
|
||||
29,
|
||||
31,
|
||||
33,
|
||||
35,
|
||||
36,
|
||||
37,
|
||||
37,
|
||||
38,
|
||||
38,
|
||||
39,
|
||||
@@ -37,23 +36,24 @@
|
||||
41,
|
||||
42,
|
||||
42,
|
||||
43,
|
||||
43,
|
||||
44,
|
||||
45,
|
||||
45,
|
||||
46,
|
||||
46,
|
||||
47,
|
||||
50,
|
||||
50,
|
||||
50,
|
||||
50,
|
||||
50,
|
||||
50,
|
||||
50,
|
||||
50,
|
||||
48,
|
||||
48,
|
||||
49,
|
||||
49,
|
||||
49,
|
||||
50,
|
||||
50,
|
||||
51,
|
||||
51,
|
||||
51,
|
||||
51,
|
||||
52,
|
||||
54,
|
||||
53,
|
||||
57,
|
||||
61,
|
||||
62,
|
||||
@@ -69,7 +69,6 @@
|
||||
64,
|
||||
64,
|
||||
64,
|
||||
64,
|
||||
65,
|
||||
65,
|
||||
65,
|
||||
@@ -77,7 +76,6 @@
|
||||
66,
|
||||
66,
|
||||
66,
|
||||
66,
|
||||
67,
|
||||
67,
|
||||
67,
|
||||
@@ -86,16 +84,18 @@
|
||||
68,
|
||||
69,
|
||||
69,
|
||||
69,
|
||||
70,
|
||||
70,
|
||||
71,
|
||||
72,
|
||||
73,
|
||||
74,
|
||||
74,
|
||||
75,
|
||||
76,
|
||||
77,
|
||||
78,
|
||||
79,
|
||||
80,
|
||||
81,
|
||||
83,
|
||||
85,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import asyncio
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from datetime import date, datetime, timedelta, timezone
|
||||
|
||||
import httpx
|
||||
|
||||
@@ -87,6 +87,32 @@ async def _fetch_weather_chunk(client: httpx.AsyncClient, points: list[tuple[flo
|
||||
return await _get_forecast(client, params, len(points))
|
||||
|
||||
|
||||
async def fetch_snow(client: httpx.AsyncClient, points: list[tuple[float, float]], days: int = 7) -> list[dict]:
|
||||
"""좌표마다 날짜별(한국 날짜) 눈 오는 양 (모델 지정 없음). 응답 순서는 좌표 순서와 같다."""
|
||||
chunks = [points[i:i + _CHUNK] for i in range(0, len(points), _CHUNK)]
|
||||
|
||||
async def all_chunks() -> list[dict]:
|
||||
results = await asyncio.gather(*[_fetch_snow_chunk(client, c, days) for c in chunks])
|
||||
return [d for r in results for d in r]
|
||||
|
||||
return await guarded("openmeteo:snow", all_chunks, OpenMeteoRequestFailed, _BUDGET_SEC)
|
||||
|
||||
|
||||
async def _fetch_snow_chunk(client: httpx.AsyncClient, points: list[tuple[float, float]], days: int) -> list[dict]:
|
||||
params = {
|
||||
"latitude": ",".join(f"{lat:.2f}" for lat, _ in points),
|
||||
"longitude": ",".join(f"{lon:.2f}" for _, lon in points),
|
||||
"daily": "snowfall_sum", "forecast_days": days, "timezone": "Asia/Seoul",
|
||||
}
|
||||
return await _get_forecast(client, params, len(points))
|
||||
|
||||
|
||||
def parse_snow(data: dict) -> list[tuple[date, float]]:
|
||||
"""날짜별 눈 오는 양(cm). 값이 없는 날은 뺀다."""
|
||||
d = data["daily"]
|
||||
return [(date.fromisoformat(t), float(v)) for t, v in zip(d["time"], d["snowfall_sum"]) if v is not None]
|
||||
|
||||
|
||||
def parse_clouds(point: tuple[float, float], data: dict) -> list[dict]:
|
||||
lat, lon = round(point[0], 2), round(point[1], 2)
|
||||
h = data["hourly"]
|
||||
|
||||
@@ -11,7 +11,7 @@ from common.cache.lock import redis_lock
|
||||
from common.cache.redis_client import REDIS
|
||||
from common.database.db_session_manager import DB_SESSION_MNG
|
||||
from common.database.model.models import Article, CardSet, IndexScore, OpenMeteoHourly, Post, Region, WeatherHourly
|
||||
from common.enums import AirGrade, ArticleCategory, ErrorType, PostType, RainType, RefType, Sky, SkyGrade, SkySituation, SkyType, WarningType
|
||||
from common.enums import AirGrade, ArticleCategory, ErrorType, EventKind, PostType, RainType, RefType, Sky, SkyGrade, SkySituation, SkyType, WarningType
|
||||
from common.logger import LOG
|
||||
from common.utils.kma_time import KST, ULTRA_DELAY, kst_midnight, latest_ultra_base, next_vilage_available, now_kst
|
||||
from common.utils.text import compass, day_range, hour_label, short_day
|
||||
@@ -22,7 +22,7 @@ from crud.season_crud import SeasonCRUD
|
||||
from crud.weather_crud import WeatherCRUD
|
||||
from router.v1.feed.protocol import (
|
||||
BandArticle, BandEvent, Bands, Cut, GakSlide, Hero, HeroStat, HeroTomorrow, HourCell, HoursSlide, ImageSlide, PostData, PostReaction, Res_Feed, Row, RowsSlide, SunsetSlide,
|
||||
PlanSlide, PlanStep, TopIndex, WeatherWhy, WeekDay, WeekGak, WeekSlide,
|
||||
PlanSlide, PlanStep, TomorrowEvent, TopIndex, WeatherWhy, WeekDay, WeekGak, WeekSlide,
|
||||
)
|
||||
from router.v1.index.protocol import TrendPoint
|
||||
from services.air_service import GRADE_LABEL as AIR_GRADE_LABEL
|
||||
@@ -39,11 +39,14 @@ from services.now_service import NowService, NowWeather
|
||||
from services.season_service import SeasonService
|
||||
from services.sky_service import SkyService, SkyView, day_verdict
|
||||
from services.weather_service import TodayWeather, WeatherService
|
||||
from services.week_service import DayPlan, EventItem, WeekService, image_credit, mix_kinds
|
||||
from services.week_service import DayPlan, EventItem, WeekService, event_sidos, image_credit, mix_kinds
|
||||
from services.weekend_plan import day_plan, forecast, pick_events
|
||||
from services.weekend_rank import TripPick, WeekendRank, pick_trip, weekend_days
|
||||
|
||||
# 그날 피드 카드: (번호, 종류, 참조, 지수 순위). 03:00 에 전부 만들고, 볼 때 시간대에 따라 켜고 끄고 순서를 정한다 (docs/피드_기획.html).
|
||||
# 행사 포스트: 축제는 전부, 팝업·전시·콘서트는 종류마다 이만큼. 자리는 _EVENT_SLOTS 개까지
|
||||
_EVENT_OTHERS = 2
|
||||
_EVENT_SLOTS = 40
|
||||
# 그날 피드 카드: (번호, 종류, 참조, 지수 순위). 03:00 에 전부 만들고, 볼 때 시간대에 따라 켜고 끄고 순서를 정한다 (docs/서비스_동작_안내.md).
|
||||
LINEUP = [
|
||||
(1, PostType.WEATHER, RefType.NONE, None),
|
||||
(2, PostType.ALERT, RefType.NONE, None),
|
||||
@@ -70,6 +73,7 @@ LINEUP = [
|
||||
(23, PostType.FOLIAGE, RefType.NONE, None),
|
||||
(24, PostType.EVENTS_BAND, RefType.NONE, None),
|
||||
(25, PostType.SEASON_BAND, RefType.NONE, None),
|
||||
*((22 + rank, PostType.EVENT, RefType.NONE, rank) for rank in range(4, _EVENT_SLOTS + 1)),
|
||||
]
|
||||
# 피드 목록 대신 히어로·오늘의 각·단풍 지도·띠에 좋아요·댓글만 붙는 자리
|
||||
_PINNED = {
|
||||
@@ -237,9 +241,12 @@ def arrange(cards: list[PostData], slot: str, now: datetime, sunset_at: datetime
|
||||
rest = [c for c in rest if c.post_type is not PostType.QUOTE] + [c for c in rest if c.post_type is PostType.QUOTE]
|
||||
events = pool.get(PostType.EVENT, [])
|
||||
front = range(1, max(1, len(rest) // 2 + 1))
|
||||
gaps = sorted(random.Random(seed).sample(front, min(len(events), len(front))), reverse=True)
|
||||
# 앞쪽 절반에 다 못 들어가면 끝까지 한 장씩 걸러 끼우고, 그래도 남은 행사는 맨 뒤에
|
||||
gaps = (sorted(random.Random(seed).sample(front, len(events)), reverse=True) if len(events) <= len(front)
|
||||
else list(range(min(len(events), len(rest)), 0, -1)))
|
||||
for gap, e in zip(gaps, reversed(events[:len(gaps)])):
|
||||
rest.insert(gap, e)
|
||||
rest += events[len(gaps):]
|
||||
# 카드뉴스(관리자가 올린 것)는 날씨 바로 아래, 같은 날 두 번째부터는 피드 중간쯤
|
||||
cards = pool.get(PostType.CARD, [])
|
||||
for i, card in enumerate(cards[1:]):
|
||||
@@ -255,24 +262,24 @@ def _by_position(posts: list[Post]) -> list[Post]:
|
||||
return list(out.values())
|
||||
|
||||
|
||||
def _tomorrow_best(board: IndexBoard, day: date) -> Optional[tuple[IndexItem, IndexScore]]:
|
||||
"""내일 하루 점수로 1위인 각과 그 점수 (동점이면 중요도 순)."""
|
||||
best = None
|
||||
for i in board.items:
|
||||
s = next((x for x in i.trend if x.score_date == day), None)
|
||||
if s is not None and (best is None or rank_score(s.score, i.definition.priority) > rank_score(best[1].score, best[0].definition.priority)):
|
||||
best = (i, s)
|
||||
return best
|
||||
def _tomorrow_ranked(board: IndexBoard, day: date) -> list[tuple[IndexItem, IndexScore]]:
|
||||
"""내일 하루 점수 순으로 제철 각과 그 점수 (동점이면 중요도 순)."""
|
||||
scored = [(i, s) for i in board.items if i.in_season for s in i.trend if s.score_date == day]
|
||||
return sorted(scored, key=lambda x: rank_score(x[1].score, x[0].definition.priority), reverse=True)
|
||||
|
||||
|
||||
def tomorrow_events(items: list[EventItem], region_code: str, day: date) -> list[TomorrowEvent]:
|
||||
"""그날 열리는 같은 시도 행사 3개 (종류를 섞어서)."""
|
||||
on = [e for e in items if e.event.sido_code in event_sidos(region_code) and e.event.start_date <= day <= e.event.end_date]
|
||||
return [TomorrowEvent(event_id=e.event.event_id, name=e.event.name, place=e.event.place_name, icon=e.event.icon,
|
||||
start_date=e.event.start_date, end_date=e.event.end_date) for e in mix_kinds(on)[:3]]
|
||||
|
||||
|
||||
def _hero_tomorrow(day: date, board: IndexBoard) -> HeroTomorrow:
|
||||
best = _tomorrow_best(board, day)
|
||||
top1 = None
|
||||
if best is not None:
|
||||
d, s = best[0].definition, best[1]
|
||||
top1 = TopIndex(index_id=d.index_id, code=d.code, name=d.name, icon=d.icon, score=s.score, rank=1, summary=s.summary)
|
||||
ranked = [TopIndex(index_id=i.definition.index_id, code=i.definition.code, name=i.definition.name, icon=i.definition.icon, score=s.score,
|
||||
rank=n, summary=s.summary) for n, (i, s) in enumerate(_tomorrow_ranked(board, day)[:5], 1)]
|
||||
return HeroTomorrow(
|
||||
day=day, weather_slots=board.tomorrow_slots, top1=top1,
|
||||
day=day, weather_slots=board.tomorrow_slots, top1=ranked[0] if ranked else None, ranked=ranked,
|
||||
weather_why={k: [WeatherWhy(label=w.label, weight=w.weight, score=w.score, note=w.note) for w in ws] for k, ws in board.tomorrow_why.items()},
|
||||
)
|
||||
|
||||
@@ -429,9 +436,12 @@ class FeedService:
|
||||
has_warning = bool(now_w and now_w.warnings)
|
||||
# 오늘 이야기 줄엔 제철인 각만 (철 지난 각은 각 탭 목록 끝에만)
|
||||
items = [i for i in board.items if i.in_season] if board else []
|
||||
hero = self._hero(now, slot, hourly[0] if hourly else None, now_w, board, today, await self._uv(region.code, hour), _moon_view(region, now, hourly or []))
|
||||
if hero.tomorrow is not None:
|
||||
hero.tomorrow.events = tomorrow_events(events, region.code, hero.tomorrow.day)
|
||||
feed = Res_Feed(
|
||||
region_code=region.code, region_name=region.name, slot=slot,
|
||||
hero=self._hero(now, slot, hourly[0] if hourly else None, now_w, board, today, await self._uv(region.code, hour), _moon_view(region, now, hourly or [])),
|
||||
hero=hero,
|
||||
stories=[_top(i) for i in items], posts=arrange(cards, slot, now, sunset_at, has_warning, f"{day}:{region.code}"), **pinned,
|
||||
bands=Bands(
|
||||
events=[BandEvent(event_id=e.event.event_id, name=e.event.name, status_label=e.status_label, icon=e.event.icon,
|
||||
@@ -537,7 +547,7 @@ class FeedService:
|
||||
slides=[RowsSlide(kind="rows", eyebrow=_CATEGORY_META[a.category], line=a.body[0], icon=a.icon, image=a.image_url, image_credit=a.image_credit)],
|
||||
share_messages=[a.title])
|
||||
if t is PostType.EVENT:
|
||||
soon = mix_kinds([e for e in c.events if e.event.start_date <= c.now.date() + timedelta(days=7) and e.event.end_date >= c.now.date()])
|
||||
soon = feed_events([e for e in c.events if e.event.start_date <= c.now.date() + timedelta(days=7) and e.event.end_date >= c.now.date()])
|
||||
rank = p.index_rank or 1
|
||||
if len(soon) < rank:
|
||||
return None
|
||||
@@ -757,8 +767,9 @@ class FeedService:
|
||||
|
||||
def _tomorrow(self, base: dict, c: "_Ctx") -> PostData:
|
||||
rows = [Row(label=x.label, value=x.text) for x in c.now_w.commute]
|
||||
best = _tomorrow_best(c.board, c.now.date() + timedelta(days=1)) if c.board else None
|
||||
if best is not None:
|
||||
ranked = _tomorrow_ranked(c.board, c.now.date() + timedelta(days=1)) if c.board else []
|
||||
if ranked:
|
||||
best = ranked[0]
|
||||
rows.append(Row(label="내일 1위 각", value=f"{best[0].definition.name} {best[1].score}점"))
|
||||
caption = _temp_change(c.today, c.tomorrow) or "출근 전에 한 번 더 확인해 주세요."
|
||||
icon = c.now_w.commute[0].icon if c.now_w.commute else "sun"
|
||||
@@ -811,6 +822,18 @@ def _temp_change(today: Optional[TodayWeather], tomorrow: Optional[TodayWeather]
|
||||
return f"내일 낮 최고 {round(highs[1])}°, 오늘보다 {abs(diff)}° {'더워요' if diff > 0 else '쌀쌀해요'}."
|
||||
|
||||
|
||||
def feed_events(items: list[EventItem]) -> list[EventItem]:
|
||||
"""피드에 포스트로 올릴 행사. 축제는 전부, 다른 종류는 받은 순서대로 _EVENT_OTHERS 개씩 골라 종류를 돌아가며 섞는다."""
|
||||
taken: dict[int, int] = {}
|
||||
picked = []
|
||||
for e in items:
|
||||
n = taken.get(e.event.kind, 0)
|
||||
if e.event.kind == EventKind.FESTIVAL or n < _EVENT_OTHERS:
|
||||
picked.append(e)
|
||||
taken[e.event.kind] = n + 1
|
||||
return mix_kinds(picked)
|
||||
|
||||
|
||||
def _event_caption(e: EventItem) -> str:
|
||||
"""진행 상태·거리·그날 날씨 중 있는 것. 다 없으면 일정 확정 여부."""
|
||||
parts = ["지금 진행 중" if e.status == "live" else e.status_label]
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"source": "기상청 「계절관측지침(2026.4.)」 부록 기후계절 평년값(1991~2020년) 첫눈. 북춘천은 춘천, 북강릉은 강릉으로 적음. 먼 섬(백령도·울릉도·흑산도)과 평년 첫눈이 해를 넘기는 거제(1/14)는 뺌",
|
||||
"basis": "normal 은 평년 첫눈 날짜(월-일). lat·lon 은 그 도시의 대략 위치(지도에 찍고 눈 예보를 받는 자리). top 은 처음 화면에 이름까지 보이는 대표 지점",
|
||||
"spots": [
|
||||
{ "name": "서울", "region": "서울", "lat": 37.57, "lon": 126.97, "normal": "11-20", "top": true },
|
||||
{ "name": "인천", "region": "인천", "lat": 37.48, "lon": 126.62, "normal": "11-23" },
|
||||
{ "name": "수원", "region": "경기", "lat": 37.27, "lon": 126.99, "normal": "11-21" },
|
||||
{ "name": "파주", "region": "경기", "lat": 37.89, "lon": 126.77, "normal": "11-20" },
|
||||
{ "name": "이천", "region": "경기", "lat": 37.26, "lon": 127.48, "normal": "11-20" },
|
||||
{ "name": "철원", "region": "강원", "lat": 38.15, "lon": 127.3, "normal": "11-18" },
|
||||
{ "name": "춘천", "region": "강원", "lat": 37.95, "lon": 127.75, "normal": "11-21", "top": true },
|
||||
{ "name": "원주", "region": "강원", "lat": 37.34, "lon": 127.95, "normal": "11-21" },
|
||||
{ "name": "대관령", "region": "강원", "lat": 37.68, "lon": 128.72, "normal": "11-05", "top": true },
|
||||
{ "name": "속초", "region": "강원", "lat": 38.25, "lon": 128.56, "normal": "12-10" },
|
||||
{ "name": "강릉", "region": "강원", "lat": 37.8, "lon": 128.86, "normal": "12-07", "top": true },
|
||||
{ "name": "동해", "region": "강원", "lat": 37.51, "lon": 129.12, "normal": "12-11" },
|
||||
{ "name": "태백", "region": "강원", "lat": 37.17, "lon": 128.99, "normal": "11-10" },
|
||||
{ "name": "서산", "region": "충남", "lat": 36.78, "lon": 126.49, "normal": "11-20" },
|
||||
{ "name": "천안", "region": "충남", "lat": 36.78, "lon": 127.12, "normal": "11-19" },
|
||||
{ "name": "보령", "region": "충남", "lat": 36.33, "lon": 126.56, "normal": "11-22" },
|
||||
{ "name": "청주", "region": "충북", "lat": 36.64, "lon": 127.44, "normal": "11-23" },
|
||||
{ "name": "충주", "region": "충북", "lat": 36.97, "lon": 127.95, "normal": "11-24" },
|
||||
{ "name": "추풍령", "region": "충북", "lat": 36.22, "lon": 127.99, "normal": "11-17" },
|
||||
{ "name": "대전", "region": "대전", "lat": 36.37, "lon": 127.37, "normal": "11-20", "top": true },
|
||||
{ "name": "전주", "region": "전북", "lat": 35.82, "lon": 127.15, "normal": "11-29", "top": true },
|
||||
{ "name": "군산", "region": "전북", "lat": 36.0, "lon": 126.76, "normal": "11-26" },
|
||||
{ "name": "남원", "region": "전북", "lat": 35.41, "lon": 127.33, "normal": "11-24" },
|
||||
{ "name": "광주", "region": "광주", "lat": 35.17, "lon": 126.89, "normal": "11-29", "top": true },
|
||||
{ "name": "목포", "region": "전남", "lat": 34.82, "lon": 126.38, "normal": "11-29" },
|
||||
{ "name": "순천", "region": "전남", "lat": 35.02, "lon": 127.37, "normal": "11-24" },
|
||||
{ "name": "여수", "region": "전남", "lat": 34.74, "lon": 127.74, "normal": "12-13" },
|
||||
{ "name": "완도", "region": "전남", "lat": 34.4, "lon": 126.7, "normal": "12-08" },
|
||||
{ "name": "안동", "region": "경북", "lat": 36.57, "lon": 128.71, "normal": "11-29" },
|
||||
{ "name": "구미", "region": "경북", "lat": 36.13, "lon": 128.32, "normal": "11-30" },
|
||||
{ "name": "울진", "region": "경북", "lat": 36.99, "lon": 129.41, "normal": "12-09" },
|
||||
{ "name": "포항", "region": "경북", "lat": 36.03, "lon": 129.38, "normal": "12-18" },
|
||||
{ "name": "대구", "region": "대구", "lat": 35.88, "lon": 128.62, "normal": "12-05", "top": true },
|
||||
{ "name": "거창", "region": "경남", "lat": 35.67, "lon": 127.91, "normal": "12-13" },
|
||||
{ "name": "진주", "region": "경남", "lat": 35.16, "lon": 128.04, "normal": "12-18" },
|
||||
{ "name": "창원", "region": "경남", "lat": 35.17, "lon": 128.57, "normal": "12-27" },
|
||||
{ "name": "통영", "region": "경남", "lat": 34.85, "lon": 128.44, "normal": "12-27" },
|
||||
{ "name": "울산", "region": "울산", "lat": 35.56, "lon": 129.32, "normal": "12-24" },
|
||||
{ "name": "부산", "region": "부산", "lat": 35.1, "lon": 129.03, "normal": "12-23", "top": true },
|
||||
{ "name": "제주", "region": "제주", "lat": 33.51, "lon": 126.53, "normal": "12-10", "top": true },
|
||||
{ "name": "서귀포", "region": "제주", "lat": 33.25, "lon": 126.57, "normal": "12-20" },
|
||||
{ "name": "성산", "region": "제주", "lat": 33.39, "lon": 126.88, "normal": "12-13" }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import json
|
||||
from dataclasses import dataclass
|
||||
from datetime import date, datetime
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
import httpx
|
||||
from redis.exceptions import RedisError
|
||||
|
||||
from common.cache.redis_client import REDIS
|
||||
from common.logger import LOG
|
||||
from common.utils.kma_time import KST
|
||||
from services.external.open_meteo import OpenMeteoRequestFailed, fetch_snow, parse_snow
|
||||
|
||||
# 지점별 평년 첫눈 날짜 (기상청 계절관측지침, 1991~2020). 출처·기준은 파일 안에 적혀 있다
|
||||
SPOTS: list[dict] = json.loads((Path(__file__).parent / "first_snow.json").read_text(encoding="utf-8"))["spots"]
|
||||
|
||||
_DAYS = 7
|
||||
# 하루 눈 오는 양이 이만큼(cm)은 돼야 '눈 예보'로 친다 (0 에 가까운 값은 뺀다)
|
||||
_MIN_CM = 0.1
|
||||
# 눈 예보는 3시간에 한 번만 받는다. 첫 사용자가 볼 때 받아 Redis 에 둔다
|
||||
_KEY = "firstsnow:forecast"
|
||||
_TTL_SEC = 3 * 3600
|
||||
|
||||
|
||||
@dataclass
|
||||
class SnowSpot:
|
||||
name: str
|
||||
region: str
|
||||
lat: float
|
||||
lon: float
|
||||
normal: str
|
||||
top: bool
|
||||
snow_date: Optional[date] = None
|
||||
snow_cm: Optional[float] = None
|
||||
|
||||
|
||||
def first_snow_day(days: list[tuple[date, float]], today: date) -> Optional[tuple[date, float]]:
|
||||
"""오늘부터 눈 예보가 있는 첫 날과 그날 양. 없으면 None."""
|
||||
return next(((d, cm) for d, cm in sorted(days) if d >= today and cm >= _MIN_CM), None)
|
||||
|
||||
|
||||
class FirstSnowService:
|
||||
async def spots(self, now: datetime) -> tuple[bool, list[SnowSpot]]:
|
||||
"""(눈 예보를 받았는지, 지점 목록). 예보를 못 받아도 평년 날짜는 돌려준다."""
|
||||
forecast = await self._forecast()
|
||||
today = now.astimezone(KST).date()
|
||||
out = []
|
||||
for s in SPOTS:
|
||||
hit = first_snow_day(forecast[s["name"]], today) if forecast and s["name"] in forecast else None
|
||||
out.append(SnowSpot(
|
||||
name=s["name"], region=s["region"], lat=s["lat"], lon=s["lon"], normal=s["normal"], top=bool(s.get("top")),
|
||||
snow_date=hit[0] if hit else None, snow_cm=round(hit[1], 1) if hit else None,
|
||||
))
|
||||
return forecast is not None, out
|
||||
|
||||
async def _forecast(self) -> Optional[dict[str, list[tuple[date, float]]]]:
|
||||
"""지점 이름 → 날짜별 눈 오는 양. Redis 에 있으면 그것을, 없으면 Open-Meteo 에서 받아 둔다. 못 받으면 None."""
|
||||
try:
|
||||
cached = await REDIS.conn.get(_KEY)
|
||||
if cached:
|
||||
return {name: [(date.fromisoformat(d), cm) for d, cm in days] for name, days in json.loads(cached).items()}
|
||||
except RedisError as e:
|
||||
LOG.error(f"[first_snow] cache read: {e}")
|
||||
try:
|
||||
async with httpx.AsyncClient(timeout=10) as client:
|
||||
data = await fetch_snow(client, [(s["lat"], s["lon"]) for s in SPOTS], _DAYS)
|
||||
except OpenMeteoRequestFailed as e:
|
||||
LOG.error(f"[first_snow] {e}")
|
||||
return None
|
||||
forecast = {s["name"]: parse_snow(d) for s, d in zip(SPOTS, data)}
|
||||
try:
|
||||
await REDIS.conn.set(_KEY, json.dumps({name: [[d.isoformat(), cm] for d, cm in days] for name, days in forecast.items()}), ex=_TTL_SEC)
|
||||
except RedisError as e:
|
||||
LOG.error(f"[first_snow] cache write: {e}")
|
||||
return forecast
|
||||
@@ -19,7 +19,7 @@ from crud.weather_crud import WeatherCRUD
|
||||
from crud.week_crud import WeekCRUD
|
||||
from services.air_service import GRADE_LABEL, AirService
|
||||
from services.calc.day_slot import NIGHT_END_HOUR, SLOTS, slot_hours, slot_of
|
||||
from services.calc.index_calc import AXES, Context, DayForecast, Hour, Result, estimate, evaluate, priority_score, rank_score
|
||||
from services.calc.index_calc import AXES, Context, DayForecast, Hour, Result, estimate, evaluate, priority_score, rank_score, summary_line
|
||||
from services.calc.moon import night, up_ratio, view_line
|
||||
from services.calc.sun import sun_times
|
||||
from services.external.open_meteo import is_dark_slot
|
||||
@@ -240,8 +240,7 @@ def slot_results(
|
||||
"""각 구간의 날씨로 평가한다. 활동 시간대와 안 겹쳐도 계산하되 시간 요소는 0점. now 가 있으면 현재 구간은 남은 시각만 본다."""
|
||||
hours_by_slot = slot_hours(day, sunset_at)
|
||||
hours_by_slot[EARLY] = set(range(NIGHT_END_HOUR))
|
||||
if now:
|
||||
_trim_passed(hours_by_slot, day, sunset_at, now)
|
||||
cur = _trim_passed(hours_by_slot, day, sunset_at, now) if now else None
|
||||
activity = [{h % 24 for h in w} for w in window_hours(defn, day, region)]
|
||||
out = {}
|
||||
for key, hours in hours_by_slot.items():
|
||||
@@ -253,6 +252,9 @@ def slot_results(
|
||||
windows = windows_for(window, day, region, by_at, by_om, only=hours)
|
||||
result = evaluate(defn, windows, replace(ctx, time_matches=matches))
|
||||
if result is not None:
|
||||
# 지금 구간 줄은 남은 시간의 가운데가 아니라 지금 시각 날씨로
|
||||
if key == cur and windows and windows[0]:
|
||||
result.summary = summary_line(windows[0][0])
|
||||
out[key] = result
|
||||
return out
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ from common.utils.kma_time import kst_midnight, now_kst
|
||||
from crud.feed_crud import FeedCRUD
|
||||
from crud.reaction_crud import ReactionCRUD
|
||||
from crud.region_crud import RegionCRUD
|
||||
from crud.talk_crud import TalkCRUD
|
||||
from services.bot_comment import BOT_COLORS, BOT_NAMES
|
||||
from services.level_service import award
|
||||
from services.talk_service import _LINK, _PHONE
|
||||
@@ -43,8 +44,10 @@ class SavedView:
|
||||
|
||||
|
||||
class ReactionService:
|
||||
def __init__(self, crud: ReactionCRUD = Depends(ReactionCRUD), feed: FeedCRUD = Depends(FeedCRUD), regions: RegionCRUD = Depends(RegionCRUD)) -> None:
|
||||
self.crud, self.feed, self.regions = crud, feed, regions
|
||||
def __init__(
|
||||
self, crud: ReactionCRUD = Depends(ReactionCRUD), feed: FeedCRUD = Depends(FeedCRUD), regions: RegionCRUD = Depends(RegionCRUD), talks: TalkCRUD = Depends(TalkCRUD),
|
||||
) -> None:
|
||||
self.crud, self.feed, self.regions, self.talks = crud, feed, regions, talks
|
||||
|
||||
async def _post_exists(self, post_id: int) -> ErrorType:
|
||||
err, post = await DB_SESSION_MNG.execute_lambda(lambda s: self.feed.get(s, post_id))
|
||||
@@ -100,8 +103,9 @@ class ReactionService:
|
||||
return CommentView(comment=c, nickname=f"{c.region_name} 익명" if c.region_name else "익명", character=ANON_CHARACTER, color=ANON_COLOR, mood=None, liked=liked, mine=mine)
|
||||
return CommentView(comment=c, nickname=nickname or "", character=character or ANON_CHARACTER, color=color or ANON_COLOR, mood=mood, liked=liked, mine=c.user_id == who.user_id)
|
||||
|
||||
async def comments(self, post_id: int, user: Optional[User], ip_hash: str, cursor: Optional[int]) -> tuple[ErrorType, list[CommentView]]:
|
||||
err, rows = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.comments(s, post_id, user.user_id if user else None, cursor, PAGE))
|
||||
async def comments(self, post_id: Optional[int], user: Optional[User], ip_hash: str, cursor: Optional[int], talk_id: Optional[int] = None) -> tuple[ErrorType, list[CommentView]]:
|
||||
"""포스트 댓글, talk_id 가 있으면 그 사람 글의 댓글."""
|
||||
err, rows = await DB_SESSION_MNG.execute_lambda(lambda s: self.crud.comments(s, post_id, user.user_id if user else None, cursor, PAGE, talk_id))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return err, []
|
||||
liked: set[int] = set()
|
||||
@@ -146,6 +150,26 @@ class ReactionService:
|
||||
await award(user.user_id, "react", f"comment:{c.comment_id}")
|
||||
return err, self._view(c, user.nickname, user.character, user.color, user.mood, False, who)
|
||||
|
||||
async def add_talk_comment(self, talk_id: int, user: User, who: Liker, body: str) -> tuple[ErrorType, Optional[CommentView]]:
|
||||
"""사람 글 댓글은 로그인한 사람만 쓴다. 글처럼 링크·전화번호는 막는다."""
|
||||
body = body.strip()
|
||||
if not body or len(body) > COMMENT_MAX:
|
||||
return ErrorType.INVALID_INPUT, None
|
||||
if user.terms_agreed_at is None:
|
||||
return ErrorType.TERMS_REQUIRED, None
|
||||
if _LINK.search(body) or _PHONE.search(body):
|
||||
return ErrorType.LINK_NOT_ALLOWED, None
|
||||
err, talk = await DB_SESSION_MNG.execute_lambda(lambda s: self.talks.get(s, talk_id))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
return err, None
|
||||
if talk is None or talk.hidden:
|
||||
return ErrorType.NOT_FOUND, None
|
||||
err, c = await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.add_comment(s, None, who, body, None, talk_id))
|
||||
if c is None:
|
||||
return err, None
|
||||
await award(user.user_id, "react", f"comment:{c.comment_id}")
|
||||
return err, self._view(c, user.nickname, user.character, user.color, user.mood, False, who)
|
||||
|
||||
async def delete_comment(self, comment_id: int, who: Liker) -> ErrorType:
|
||||
err, ok = await DB_SESSION_MNG.execute_lambda_write(lambda s: self.crud.delete_comment(s, comment_id, who))
|
||||
if err is not ErrorType.SUCCESS:
|
||||
|
||||
@@ -4,6 +4,7 @@ from dataclasses import dataclass
|
||||
from typing import Iterable
|
||||
|
||||
from services.saju.pillars import Chart
|
||||
from services.saju.strength import POSITION_POINTS, Strength, chart_strength
|
||||
|
||||
# 글자별 (한난, 조습) 초안 — 주인 확인 필요. 한난: 차가움 −1 … 따뜻함 +1, 조습: 마름 −1 … 습함 +1
|
||||
# 丙丁巳午는 불이라 따뜻하고 말리며, 壬癸亥子는 물이라 차고 젖는다. 庚辛申酉는 가을 쇠라 서늘하고 마르고,
|
||||
@@ -18,17 +19,20 @@ CHAR_CLIMATE: dict[str, tuple[float, float]] = {
|
||||
"寅": (-0.3, 0.0), "卯": (-0.1, 0.2),
|
||||
"辰": (0.0, 0.6), # 봄 젖은 흙 (물 창고)
|
||||
"巳": (0.8, -0.3), "午": (1.0, -0.5),
|
||||
"未": (0.6, -0.7), # 여름 끝 마른 흙
|
||||
"未": (0.9, -0.7), # 대서가 든 한여름 마른 흙 (지장간 丁火)
|
||||
"申": (-0.3, -0.3), "酉": (-0.5, -0.5),
|
||||
"戌": (0.2, -0.8), # 가을 마른 흙 (불 창고)
|
||||
"亥": (-0.7, 0.8),
|
||||
}
|
||||
# 자리별 비중. 태어난 달(월령)이 계절을 정하므로 월지를 가장 크게
|
||||
CHART_WEIGHTS = {
|
||||
("year", "stem"): 1.0, ("year", "branch"): 1.0, ("month", "stem"): 1.0, ("month", "branch"): 3.0,
|
||||
("day", "stem"): 1.0, ("day", "branch"): 1.5, ("hour", "stem"): 1.0, ("hour", "branch"): 1.0,
|
||||
}
|
||||
SEASONS = {"寅卯辰": "봄", "巳午未": "여름", "申酉戌": "가을", "亥子丑": "겨울"}
|
||||
# 월령: 태어난 달이 다른 글자를 데우거나 식힌다 (『궁통보감』 조후). 달별 한난, 계절별 조습
|
||||
MONTH_TEMP = {"寅": -0.4, "卯": -0.1, "辰": 0.2, "巳": 0.6, "午": 0.9, "未": 1.0, "申": 0.4, "酉": -0.1, "戌": -0.3, "亥": -0.6, "子": -0.9, "丑": -1.0}
|
||||
SEASON_MOIST = {"봄": 0.3, "여름": -1.0, "가을": -0.5, "겨울": 1.0}
|
||||
# 월령을 받는 세기. 흙(戊己辰戌丑未)은 계절 따라 마른 흙·젖은 흙이 되므로 더 크게 받는다 (三夏己土 取癸為要, 六月土燥)
|
||||
SEASON_PULL = {"earth": {"temp": 0.5, "moist": 0.8}, "other": {"temp": 0.3, "moist": 0.2}}
|
||||
EARTH = set("戊己辰戌丑未")
|
||||
# 축이 균형(±balanced 안)일 때 이름(따뜻/서늘, 촉촉/마름)을 정할 기울기: 가장 센 오행. 토와 목은 월령을 따른다
|
||||
ELEMENT_LEAN = {"火": (1.0, -0.5), "金": (-0.5, -0.5), "水": (-0.7, 0.9)}
|
||||
|
||||
# 날씨 → 같은 두 축. 한난: 체감 15°C 가 0, 15°C 차이마다 ±1. 조습: 습도 55% 가 0, 35%p 차이마다 ±1, 비가 오면 최소 +0.8
|
||||
WEATHER_SCALE = {"neutral_c": 15.0, "span_c": 15.0, "neutral_humidity": 55.0, "span_humidity": 35.0, "rain_moist": 0.8}
|
||||
@@ -60,8 +64,9 @@ class ChartClimate:
|
||||
moist: float
|
||||
label: str # 따뜻·마름 / 따뜻·촉촉 / 서늘·마름 / 서늘·촉촉
|
||||
season: str # 월지 계절
|
||||
strength: Strength
|
||||
need: dict[str, str] # {"temp": warm|cool|mild, "moist": dry|moist|mild}
|
||||
parts: tuple[dict, ...] # 글자별 기여 {"position", "part", "char", "temp", "moist", "weight"}
|
||||
parts: tuple[dict, ...] # 글자별 기여 {"position", "part", "char", "temp", "moist", "weight"} (월령 보정 뒤 값)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -85,12 +90,30 @@ def _clamp(x: float, lo: float = -1.0, hi: float = 1.0) -> float:
|
||||
return max(lo, min(hi, x))
|
||||
|
||||
|
||||
def season_of(branch: str) -> str:
|
||||
return next(name for group, name in SEASONS.items() if branch in group)
|
||||
|
||||
|
||||
def seasoned(char: str, month_branch: str) -> tuple[float, float]:
|
||||
"""월령을 받은 글자의 (한난, 조습). 월지 자신은 계절 그 자체라 그대로 둔다."""
|
||||
t, m = CHAR_CLIMATE[char]
|
||||
pull = SEASON_PULL["earth" if char in EARTH else "other"]
|
||||
t += pull["temp"] * MONTH_TEMP[month_branch]
|
||||
m += pull["moist"] * SEASON_MOIST[season_of(month_branch)]
|
||||
return round(_clamp(t), 3), round(_clamp(m), 3)
|
||||
|
||||
|
||||
def _lean(strength: Strength, month_branch: str) -> tuple[float, float]:
|
||||
return ELEMENT_LEAN.get(strength.top) or CHAR_CLIMATE[month_branch]
|
||||
|
||||
|
||||
def chart_climate(chart: Chart) -> ChartClimate:
|
||||
mb = chart.month.branch
|
||||
parts = []
|
||||
for pos, p in chart.pillars().items():
|
||||
for part, char in (("stem", p.stem), ("branch", p.branch)):
|
||||
t, m = CHAR_CLIMATE[char]
|
||||
parts.append({"position": pos, "part": part, "char": char, "temp": t, "moist": m, "weight": CHART_WEIGHTS[(pos, part)]})
|
||||
t, m = CHAR_CLIMATE[char] if (pos, part) == ("month", "branch") else seasoned(char, mb)
|
||||
parts.append({"position": pos, "part": part, "char": char, "temp": t, "moist": m, "weight": POSITION_POINTS[(pos, part)]})
|
||||
total = sum(x["weight"] for x in parts)
|
||||
temp = round(sum(x["temp"] * x["weight"] for x in parts) / total, 3)
|
||||
moist = round(sum(x["moist"] * x["weight"] for x in parts) / total, 3)
|
||||
@@ -99,9 +122,12 @@ def chart_climate(chart: Chart) -> ChartClimate:
|
||||
"temp": "warm" if temp < -b else "cool" if temp > b else "mild",
|
||||
"moist": "dry" if moist > b else "moist" if moist < -b else "mild",
|
||||
}
|
||||
label = f"{'따뜻' if temp >= 0 else '서늘'}·{'촉촉' if moist >= 0 else '마름'}"
|
||||
season = next(name for group, name in SEASONS.items() if chart.month.branch in group)
|
||||
return ChartClimate(temp, moist, label, season, need, tuple(parts))
|
||||
strength = chart_strength(chart)
|
||||
lean_t, lean_m = _lean(strength, mb)
|
||||
warm = temp > 0 if abs(temp) > b else lean_t >= 0
|
||||
wet = moist > 0 if abs(moist) > b else lean_m >= 0
|
||||
label = f"{'따뜻' if warm else '서늘'}·{'촉촉' if wet else '마름'}"
|
||||
return ChartClimate(temp, moist, label, season_of(mb), strength, need, tuple(parts))
|
||||
|
||||
|
||||
def weather_vector(w: HourWeather) -> dict[str, float]:
|
||||
|
||||
@@ -25,6 +25,11 @@ HIDDEN_STEMS: dict[str, tuple[str, Optional[str], str]] = {
|
||||
"戌": ("辛", "丁", "戊"),
|
||||
"亥": ("戊", "甲", "壬"),
|
||||
}
|
||||
# 지장간이 맡는 날 수 (여기, 중기, 정기), 한 달 30일. 子卯酉는 중기 없이 10·20, 午는 丙10·己9·丁11
|
||||
HIDDEN_DAYS: dict[str, tuple[int, int, int]] = {
|
||||
"子": (10, 0, 20), "丑": (9, 3, 18), "寅": (7, 7, 16), "卯": (10, 0, 20), "辰": (9, 3, 18), "巳": (7, 7, 16),
|
||||
"午": (10, 9, 11), "未": (9, 3, 18), "申": (7, 7, 16), "酉": (10, 0, 20), "戌": (9, 3, 18), "亥": (7, 7, 16),
|
||||
}
|
||||
|
||||
|
||||
def stem_element(stem: str) -> str:
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
"""오행 세력과 신강·신약. 자리마다 점수를 주고, 지지 점수는 지장간 날 수대로 나눈다."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from services.saju.ganji import ELEMENTS, HIDDEN_DAYS, HIDDEN_STEMS, stem_element
|
||||
from services.saju.pillars import Chart
|
||||
|
||||
# 자리별 점수. 득령(월지) 30 · 득지(일지) 20 · 나머지 10. 일간을 뺀 일곱 자리 합이 100
|
||||
POSITION_POINTS = {
|
||||
("year", "stem"): 10, ("year", "branch"): 10, ("month", "stem"): 10, ("month", "branch"): 30,
|
||||
("day", "stem"): 10, ("day", "branch"): 20, ("hour", "stem"): 10, ("hour", "branch"): 10,
|
||||
}
|
||||
# 월령: 태어난 달의 오행. 일간 오행이 이와 같거나(왕) 달이 일간을 생하면(상) 득령. 강약은 득령을 먼저 본다
|
||||
SEASON_ELEMENT = dict(zip("寅卯巳午申酉亥子辰戌丑未", "木木火火金金水水土土土土"))
|
||||
DEUK_RYEONG_BONUS = 0.15 # 득령이면 돕는 몫에 더한다
|
||||
STRONG_FROM, WEAK_BELOW = 0.55, 0.45 # (돕는 몫 + 득령 가산) 이 이상이면 신강, 미만이면 신약, 사이는 중화
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Strength:
|
||||
elements: dict[str, float] # 오행별 점수 (일간 포함), 木火土金水 순
|
||||
top: str # 가장 센 오행
|
||||
support: float # 일간을 뺀 점수 중 일간을 돕는 오행(같은 오행·생해 주는 오행) 몫 0~1
|
||||
deuk_ryeong: bool
|
||||
label: str # 신강 · 중화 · 신약
|
||||
|
||||
@property
|
||||
def strong(self) -> bool:
|
||||
return self.label == "신강"
|
||||
|
||||
|
||||
def char_points(chart: Chart) -> list[tuple[str, str, str, float]]:
|
||||
"""(자리, stem|branch, 천간, 점수). 지지는 지장간 천간들로 나눈다."""
|
||||
out = []
|
||||
for pos, p in chart.pillars().items():
|
||||
out.append((pos, "stem", p.stem, float(POSITION_POINTS[(pos, "stem")])))
|
||||
points = POSITION_POINTS[(pos, "branch")]
|
||||
days = HIDDEN_DAYS[p.branch]
|
||||
for stem, d in zip(HIDDEN_STEMS[p.branch], days):
|
||||
if stem and d:
|
||||
out.append((pos, "branch", stem, points * d / sum(days)))
|
||||
return out
|
||||
|
||||
|
||||
def chart_strength(chart: Chart) -> Strength:
|
||||
me = ELEMENTS.index(stem_element(chart.day_stem))
|
||||
helpers = {ELEMENTS[me], ELEMENTS[(me - 1) % 5]}
|
||||
elements = dict.fromkeys(ELEMENTS, 0.0)
|
||||
support = others = 0.0
|
||||
for pos, part, stem, points in char_points(chart):
|
||||
el = stem_element(stem)
|
||||
elements[el] += points
|
||||
if (pos, part) == ("day", "stem"):
|
||||
continue
|
||||
others += points
|
||||
support += points if el in helpers else 0.0
|
||||
elements = {k: round(v, 1) for k, v in elements.items()}
|
||||
ratio = round(support / others, 3)
|
||||
deuk = SEASON_ELEMENT[chart.month.branch] in helpers
|
||||
judged = ratio + (DEUK_RYEONG_BONUS if deuk else 0.0)
|
||||
label = "신강" if judged >= STRONG_FROM else "신약" if judged < WEAK_BELOW else "중화"
|
||||
return Strength(elements, max(elements, key=elements.get), ratio, deuk, label)
|
||||
@@ -0,0 +1,275 @@
|
||||
{
|
||||
"about": "검색 결과 제목·설명 새 문구를 쓰는 지역 페이지. 나머지는 예전 문구로 두고 클릭률을 비교한다. Search Console 페이지 노출(2026-10-07~27) 많은 순으로 오늘·내일 따로 줄 세워 ABBA 로 나눔",
|
||||
"new": [
|
||||
"today/busan/busanjin",
|
||||
"today/busan/dong",
|
||||
"today/busan/geumjeong",
|
||||
"today/busan/gijang",
|
||||
"today/busan/nam",
|
||||
"today/busan/saha",
|
||||
"today/busan/suyeong",
|
||||
"today/busan/yeonje",
|
||||
"today/chungbuk/boeun",
|
||||
"today/chungbuk/eumseong",
|
||||
"today/chungbuk/jeungpyeong",
|
||||
"today/chungbuk/okcheon",
|
||||
"today/chungnam/boryeong",
|
||||
"today/chungnam/buyeo",
|
||||
"today/chungnam/cheonan/dongnam",
|
||||
"today/chungnam/cheongyang",
|
||||
"today/chungnam/geumsan",
|
||||
"today/chungnam/gongju",
|
||||
"today/chungnam/seocheon",
|
||||
"today/chungnam/seosan",
|
||||
"today/daegu/buk",
|
||||
"today/daegu/dalseo",
|
||||
"today/daegu/gunwi",
|
||||
"today/daegu/jung",
|
||||
"today/daegu/suseong",
|
||||
"today/daejeon/daedeok",
|
||||
"today/daejeon/dong",
|
||||
"today/daejeon/yuseong",
|
||||
"today/gangwon/cheorwon",
|
||||
"today/gangwon/donghae",
|
||||
"today/gangwon/goseong",
|
||||
"today/gangwon/hongcheon",
|
||||
"today/gangwon/hwacheon",
|
||||
"today/gangwon/pyeongchang",
|
||||
"today/gangwon/samcheok",
|
||||
"today/gangwon/wonju",
|
||||
"today/gangwon/yanggu",
|
||||
"today/gwangju/buk",
|
||||
"today/gwangju/dong",
|
||||
"today/gwangju/nam",
|
||||
"today/gyeongbuk/andong",
|
||||
"today/gyeongbuk/bonghwa",
|
||||
"today/gyeongbuk/cheongdo",
|
||||
"today/gyeongbuk/gimcheon",
|
||||
"today/gyeongbuk/goryeong",
|
||||
"today/gyeongbuk/gyeongsan",
|
||||
"today/gyeongbuk/mungyeong",
|
||||
"today/gyeongbuk/pohang",
|
||||
"today/gyeongbuk/pohang/buk",
|
||||
"today/gyeongbuk/uiseong",
|
||||
"today/gyeongbuk/uljin",
|
||||
"today/gyeongbuk/yeongdeok",
|
||||
"today/gyeongbuk/yeongju",
|
||||
"today/gyeonggi/anseong",
|
||||
"today/gyeonggi/anyang",
|
||||
"today/gyeonggi/anyang/dongan",
|
||||
"today/gyeonggi/anyang/manan",
|
||||
"today/gyeonggi/bucheon/sosa",
|
||||
"today/gyeonggi/bucheon/wonmi",
|
||||
"today/gyeonggi/gapyeong",
|
||||
"today/gyeonggi/gimpo",
|
||||
"today/gyeonggi/goyang/deogyang",
|
||||
"today/gyeonggi/guri",
|
||||
"today/gyeonggi/gwacheon",
|
||||
"today/gyeonggi/hanam",
|
||||
"today/gyeonggi/hwaseong/hyohaeng",
|
||||
"today/gyeonggi/namyangju",
|
||||
"today/gyeonggi/pocheon",
|
||||
"today/gyeonggi/pyeongtaek",
|
||||
"today/gyeonggi/seongnam",
|
||||
"today/gyeonggi/seongnam/bundang",
|
||||
"today/gyeonggi/seongnam/jungwon",
|
||||
"today/gyeonggi/suwon/gwonseon",
|
||||
"today/gyeonggi/suwon/jangan",
|
||||
"today/gyeonggi/suwon/paldal",
|
||||
"today/gyeonggi/suwon/yeongtong",
|
||||
"today/gyeonggi/uiwang",
|
||||
"today/gyeonggi/yangju",
|
||||
"today/gyeonggi/yeoncheon",
|
||||
"today/gyeonggi/yongin",
|
||||
"today/gyeonggi/yongin/suji",
|
||||
"today/gyeongnam/changnyeong",
|
||||
"today/gyeongnam/changwon/jinhae",
|
||||
"today/gyeongnam/changwon/masanhoewon",
|
||||
"today/gyeongnam/geoje",
|
||||
"today/gyeongnam/goseong",
|
||||
"today/gyeongnam/hadong",
|
||||
"today/gyeongnam/miryang",
|
||||
"today/gyeongnam/namhae",
|
||||
"today/gyeongnam/tongyeong",
|
||||
"today/gyeongnam/uiryeong",
|
||||
"today/incheon/ganghwa",
|
||||
"today/incheon/geomdan",
|
||||
"today/incheon/gyeyang",
|
||||
"today/incheon/namdong",
|
||||
"today/incheon/ongjin",
|
||||
"today/incheon/seohae",
|
||||
"today/jeju/jeju",
|
||||
"today/jeju/seogwipo",
|
||||
"today/jeonbuk/buan",
|
||||
"today/jeonbuk/imsil",
|
||||
"today/jeonbuk/jangsu",
|
||||
"today/jeonbuk/jeongeup",
|
||||
"today/jeonbuk/namwon",
|
||||
"today/jeonbuk/sunchang",
|
||||
"today/jeonbuk/wanju",
|
||||
"today/jeonnam/gangjin",
|
||||
"today/jeonnam/goheung",
|
||||
"today/jeonnam/gurye",
|
||||
"today/jeonnam/haenam",
|
||||
"today/jeonnam/hampyeong",
|
||||
"today/jeonnam/hwasun",
|
||||
"today/jeonnam/jindo",
|
||||
"today/jeonnam/mokpo",
|
||||
"today/jeonnam/suncheon",
|
||||
"today/jeonnam/wando",
|
||||
"today/jeonnam/yeongam",
|
||||
"today/sejong/sejong",
|
||||
"today/seoul/dobong",
|
||||
"today/seoul/dongdaemun",
|
||||
"today/seoul/gangbuk",
|
||||
"today/seoul/gangdong",
|
||||
"today/seoul/geumcheon",
|
||||
"today/seoul/guro",
|
||||
"today/seoul/jongno",
|
||||
"today/seoul/jung",
|
||||
"today/seoul/jungnang",
|
||||
"today/seoul/seocho",
|
||||
"today/seoul/seodaemun",
|
||||
"today/seoul/seongdong",
|
||||
"today/seoul/yeongdeungpo",
|
||||
"today/seoul/yongsan",
|
||||
"today/ulsan/jung",
|
||||
"today/ulsan/nam",
|
||||
"today/ulsan/ulju",
|
||||
"tomorrow/busan/gangseo",
|
||||
"tomorrow/busan/geumjeong",
|
||||
"tomorrow/busan/gijang",
|
||||
"tomorrow/busan/jung",
|
||||
"tomorrow/busan/sasang",
|
||||
"tomorrow/busan/seo",
|
||||
"tomorrow/busan/yeonje",
|
||||
"tomorrow/chungbuk/cheongju",
|
||||
"tomorrow/chungbuk/cheongju/heungdeok",
|
||||
"tomorrow/chungbuk/danyang",
|
||||
"tomorrow/chungbuk/goesan",
|
||||
"tomorrow/chungbuk/jecheon",
|
||||
"tomorrow/chungbuk/jincheon",
|
||||
"tomorrow/chungbuk/yeongdong",
|
||||
"tomorrow/chungnam/asan",
|
||||
"tomorrow/chungnam/boryeong",
|
||||
"tomorrow/chungnam/cheonan",
|
||||
"tomorrow/chungnam/cheonan/dongnam",
|
||||
"tomorrow/chungnam/cheonan/seobuk",
|
||||
"tomorrow/chungnam/dangjin",
|
||||
"tomorrow/chungnam/geumsan",
|
||||
"tomorrow/chungnam/hongseong",
|
||||
"tomorrow/chungnam/seocheon",
|
||||
"tomorrow/chungnam/seosan",
|
||||
"tomorrow/chungnam/taean",
|
||||
"tomorrow/daegu/dong",
|
||||
"tomorrow/daegu/gunwi",
|
||||
"tomorrow/daegu/nam",
|
||||
"tomorrow/daegu/suseong",
|
||||
"tomorrow/daejeon/daedeok",
|
||||
"tomorrow/daejeon/seo",
|
||||
"tomorrow/gangwon/chuncheon",
|
||||
"tomorrow/gangwon/hoengseong",
|
||||
"tomorrow/gangwon/inje",
|
||||
"tomorrow/gangwon/jeongseon",
|
||||
"tomorrow/gangwon/samcheok",
|
||||
"tomorrow/gangwon/sokcho",
|
||||
"tomorrow/gangwon/taebaek",
|
||||
"tomorrow/gangwon/wonju",
|
||||
"tomorrow/gangwon/yeongwol",
|
||||
"tomorrow/gwangju/buk",
|
||||
"tomorrow/gwangju/gwangsan",
|
||||
"tomorrow/gyeongbuk/cheongdo",
|
||||
"tomorrow/gyeongbuk/cheongsong",
|
||||
"tomorrow/gyeongbuk/goryeong",
|
||||
"tomorrow/gyeongbuk/gumi",
|
||||
"tomorrow/gyeongbuk/gyeongsan",
|
||||
"tomorrow/gyeongbuk/sangju",
|
||||
"tomorrow/gyeongbuk/seongju",
|
||||
"tomorrow/gyeongbuk/ulleung",
|
||||
"tomorrow/gyeongbuk/yeongju",
|
||||
"tomorrow/gyeonggi/ansan",
|
||||
"tomorrow/gyeonggi/ansan/sangnok",
|
||||
"tomorrow/gyeonggi/anyang",
|
||||
"tomorrow/gyeonggi/anyang/dongan",
|
||||
"tomorrow/gyeonggi/bucheon/ojeong",
|
||||
"tomorrow/gyeonggi/gimpo",
|
||||
"tomorrow/gyeonggi/goyang",
|
||||
"tomorrow/gyeonggi/gunpo",
|
||||
"tomorrow/gyeonggi/guri",
|
||||
"tomorrow/gyeonggi/gwangmyeong",
|
||||
"tomorrow/gyeonggi/hanam",
|
||||
"tomorrow/gyeonggi/hwaseong/hyohaeng",
|
||||
"tomorrow/gyeonggi/namyangju",
|
||||
"tomorrow/gyeonggi/paju",
|
||||
"tomorrow/gyeonggi/pocheon",
|
||||
"tomorrow/gyeonggi/seongnam/jungwon",
|
||||
"tomorrow/gyeonggi/siheung",
|
||||
"tomorrow/gyeonggi/suwon",
|
||||
"tomorrow/gyeonggi/suwon/gwonseon",
|
||||
"tomorrow/gyeonggi/suwon/yeongtong",
|
||||
"tomorrow/gyeonggi/uijeongbu",
|
||||
"tomorrow/gyeonggi/yangju",
|
||||
"tomorrow/gyeonggi/yangpyeong",
|
||||
"tomorrow/gyeonggi/yeoncheon",
|
||||
"tomorrow/gyeonggi/yongin/cheoin",
|
||||
"tomorrow/gyeonggi/yongin/suji",
|
||||
"tomorrow/gyeongnam/changnyeong",
|
||||
"tomorrow/gyeongnam/changwon/jinhae",
|
||||
"tomorrow/gyeongnam/changwon/uichang",
|
||||
"tomorrow/gyeongnam/geochang",
|
||||
"tomorrow/gyeongnam/goseong",
|
||||
"tomorrow/gyeongnam/haman",
|
||||
"tomorrow/gyeongnam/hamyang",
|
||||
"tomorrow/gyeongnam/hapcheon",
|
||||
"tomorrow/gyeongnam/jinju",
|
||||
"tomorrow/gyeongnam/namhae",
|
||||
"tomorrow/gyeongnam/sacheon",
|
||||
"tomorrow/gyeongnam/uiryeong",
|
||||
"tomorrow/gyeongnam/yangsan",
|
||||
"tomorrow/incheon/ganghwa",
|
||||
"tomorrow/incheon/jemulpo",
|
||||
"tomorrow/incheon/michuhol",
|
||||
"tomorrow/incheon/seohae",
|
||||
"tomorrow/jeju/jeju",
|
||||
"tomorrow/jeonbuk/buan",
|
||||
"tomorrow/jeonbuk/gimje",
|
||||
"tomorrow/jeonbuk/gochang",
|
||||
"tomorrow/jeonbuk/gunsan",
|
||||
"tomorrow/jeonbuk/jangsu",
|
||||
"tomorrow/jeonbuk/jeonju",
|
||||
"tomorrow/jeonbuk/muju",
|
||||
"tomorrow/jeonbuk/wanju",
|
||||
"tomorrow/jeonnam/boseong",
|
||||
"tomorrow/jeonnam/damyang",
|
||||
"tomorrow/jeonnam/gangjin",
|
||||
"tomorrow/jeonnam/gurye",
|
||||
"tomorrow/jeonnam/haenam",
|
||||
"tomorrow/jeonnam/jangseong",
|
||||
"tomorrow/jeonnam/jindo",
|
||||
"tomorrow/jeonnam/muan",
|
||||
"tomorrow/jeonnam/naju",
|
||||
"tomorrow/jeonnam/suncheon",
|
||||
"tomorrow/jeonnam/yeongam",
|
||||
"tomorrow/jeonnam/yeosu",
|
||||
"tomorrow/seoul/dongjak",
|
||||
"tomorrow/seoul/eunpyeong",
|
||||
"tomorrow/seoul/gangnam",
|
||||
"tomorrow/seoul/geumcheon",
|
||||
"tomorrow/seoul/guro",
|
||||
"tomorrow/seoul/gwanak",
|
||||
"tomorrow/seoul/gwangjin",
|
||||
"tomorrow/seoul/jongno",
|
||||
"tomorrow/seoul/jung",
|
||||
"tomorrow/seoul/jungnang",
|
||||
"tomorrow/seoul/nowon",
|
||||
"tomorrow/seoul/seocho",
|
||||
"tomorrow/seoul/seongdong",
|
||||
"tomorrow/seoul/songpa",
|
||||
"tomorrow/seoul/yangcheon",
|
||||
"tomorrow/seoul/yongsan",
|
||||
"tomorrow/ulsan/buk",
|
||||
"tomorrow/ulsan/dong",
|
||||
"tomorrow/ulsan/jung",
|
||||
"tomorrow/ulsan/nam"
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import json
|
||||
import re
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import date, datetime, timedelta
|
||||
from html import escape
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
import httpx
|
||||
@@ -23,6 +25,11 @@ _CODE = re.compile(r'<meta name="region-code" content="(\d+)"')
|
||||
_DESC = re.compile(r'(<meta (?:name|property)="(?:description|og:description|twitter:description)" content=")[^"]*"')
|
||||
_NAME = re.compile(r"<h1>(.+?) (?:오늘|내일) 날씨")
|
||||
_H1 = re.compile(r"(<main><h1>[^<]*</h1>)")
|
||||
_TITLE = re.compile(r"<title>[^<]*</title>")
|
||||
_TITLE_META = re.compile(r'(<meta (?:property|name)="(?:og:title|twitter:title)" content=")[^"]*"')
|
||||
_WEEKDAY = "월화수목금토일"
|
||||
# 검색 결과 새 문구를 쓰는 페이지(나머지 반은 예전 문구로 두고 클릭률을 견준다)
|
||||
NEW_COPY = frozenset(json.loads(Path(__file__).with_name("seo_copy_test.json").read_text(encoding="utf-8"))["new"])
|
||||
|
||||
|
||||
def _clock(at: datetime) -> str:
|
||||
@@ -31,19 +38,35 @@ def _clock(at: datetime) -> str:
|
||||
return f"{'오전' if at.hour < 12 else '오후'} {h}시" + (f" {at.minute}분" if at.minute else "")
|
||||
|
||||
|
||||
def _date(day: date) -> str:
|
||||
return f"{day.month}월 {day.day}일({_WEEKDAY[day.weekday()]})"
|
||||
|
||||
|
||||
def _final(word: str) -> bool:
|
||||
"""마지막 글자에 받침이 있는지 (한글이 아니면 없다고 본다)."""
|
||||
c = ord(word[-1]) - 0xAC00
|
||||
return 0 <= c < 11172 and c % 28 != 0
|
||||
|
||||
|
||||
_SKY_WORD = {Sky.CLEAR: "맑음", Sky.PARTLY: "구름 많음", Sky.CLOUDY: "흐림"}
|
||||
_RAIN_WORD = {RainType.RAIN: "비", RainType.SLEET: "비나 눈", RainType.SNOW: "눈", RainType.SHOWER: "소나기"}
|
||||
|
||||
|
||||
def _day(rows: list[WeatherHourly]) -> tuple[int, int, int, str]:
|
||||
"""하루 예보: 최저, 최고, 강수확률, 하늘 (비·눈이 있으면 그것)."""
|
||||
temps = [float(r.temp_c) for r in rows]
|
||||
wet = next((RainType(r.rain_type) for r in rows if r.rain_type != RainType.NONE.value), None)
|
||||
day = [r for r in rows if 9 <= r.forecast_at.astimezone(KST).hour <= 18] or rows
|
||||
sky = _RAIN_WORD[wet] if wet else _SKY_WORD[Sky(max({r.sky for r in day}, key=[r.sky for r in day].count))]
|
||||
return round(min(temps)), round(max(temps)), max(r.rain_prob for r in rows), sky
|
||||
|
||||
|
||||
def day_summary(rows: list[WeatherHourly]) -> str:
|
||||
"""오늘 하루 예보 요약: 최저·최고, 강수확률, 하늘 (비·눈이 있으면 그것)."""
|
||||
if not rows:
|
||||
return ""
|
||||
temps = [float(r.temp_c) for r in rows]
|
||||
wet = next((RainType(r.rain_type) for r in rows if r.rain_type != RainType.NONE.value), None)
|
||||
day = [r for r in rows if 9 <= r.forecast_at.astimezone(KST).hour <= 18] or rows
|
||||
sky = _RAIN_WORD[wet] if wet else _SKY_WORD[Sky(max({r.sky for r in day}, key=[r.sky for r in day].count))]
|
||||
return f"최저 {round(min(temps))}°·최고 {round(max(temps))}°, 강수확률 {max(r.rain_prob for r in rows)}%, {sky}."
|
||||
lo, hi, prob, sky = _day(rows)
|
||||
return f"최저 {lo}°·최고 {hi}°, 강수확률 {prob}%, {sky}."
|
||||
|
||||
|
||||
def today_line(feed: Res_Feed, rows: list[WeatherHourly], sunset_at: Optional[datetime]) -> str:
|
||||
@@ -69,6 +92,53 @@ def tomorrow_line(rows: list[WeatherHourly], sunset_at: Optional[datetime]) -> s
|
||||
return " ".join(parts)
|
||||
|
||||
|
||||
def today_copy(day: date, place: str, feed: Res_Feed, rows: list[WeatherHourly], sunset_at: Optional[datetime]) -> str:
|
||||
"""새 문구의 오늘 설명: 날짜·지역, 하루 예보, 아침·낮 1위 각, 미세먼지·불쾌지수·자외선, 해 지는 시각."""
|
||||
weather = ""
|
||||
if rows:
|
||||
lo, hi, prob, _ = _day(rows)
|
||||
weather = f": 최저 {lo}°·최고 {hi}°, 비 올 확률 {prob}%"
|
||||
parts = [f"{_date(day)} {place} 오늘 날씨{weather}."]
|
||||
# 아침·낮 1위가 같으면 한 번만: 아침·낮엔 캠핑각
|
||||
firsts: dict[str, list[str]] = {}
|
||||
for slot, label in SLOT_LABEL.items():
|
||||
for s in feed.stories:
|
||||
if slot in ("morning", "day") and s.slot_ranks.get(slot) == 1:
|
||||
firsts.setdefault(s.name, []).append(label)
|
||||
if firsts:
|
||||
said = ", ".join("·".join(labels) + f"엔 {name}" for name, labels in firsts.items())
|
||||
parts.append(f"{said}{'이' if _final(list(firsts)[-1]) else '가'} 1위예요.")
|
||||
status = {s.label: s.value for s in feed.hero.status} if feed.hero else {}
|
||||
tail = [f"{label} {status[label]}" for label in ("미세먼지", "불쾌지수", "자외선") if label in status]
|
||||
if sunset_at:
|
||||
tail.append(f"해 지는 시각 {_clock(sunset_at)}")
|
||||
if tail:
|
||||
parts.append(", ".join(tail) + ".")
|
||||
return " ".join(parts)
|
||||
|
||||
|
||||
def tomorrow_copy(day: date, place: str, rows: list[WeatherHourly], top1: Optional[str], sunset_at: Optional[datetime]) -> str:
|
||||
"""새 문구의 내일 설명: 날짜·지역, 내일 하루 예보, 내일 1위 각, 해 지는 시각."""
|
||||
if not rows:
|
||||
return ""
|
||||
lo, hi, prob, sky = _day(rows)
|
||||
line = f"{_date(day)} {place} 내일 날씨: 최저 {lo}°·최고 {hi}°, {sky}, 비 올 확률 {prob}%."
|
||||
tail = ([f"내일 하기 좋은 일 1위는 {top1}"] if top1 else []) + ([f"해 지는 시각은 {_clock(sunset_at)}"] if sunset_at else [])
|
||||
if not tail:
|
||||
return line
|
||||
return f"{line} {', '.join(tail)}{'이에요' if _final(tail[-1]) else '예요'}."
|
||||
|
||||
|
||||
def _retitle(html: str, title: str) -> str:
|
||||
html = _TITLE.sub(lambda _: f"<title>{escape(title)}</title>", html, count=1)
|
||||
return _TITLE_META.sub(lambda m: f'{m.group(1)}{escape(title, quote=True)}"', html)
|
||||
|
||||
|
||||
def _mark(html: str, copy: str) -> str:
|
||||
"""앱이 검색 유입 GA 에 어느 문구로 들어왔는지 실어 보내게 표시한다."""
|
||||
return html.replace("</head>", f'<meta name="seo-copy" content="{copy}" />\n </head>', 1)
|
||||
|
||||
|
||||
def _put(template: str, line: str, extra: str = "") -> str:
|
||||
"""설명 메타와 본문 h1 바로 아래에 한 줄을 넣는다."""
|
||||
if not line:
|
||||
@@ -77,11 +147,14 @@ def _put(template: str, line: str, extra: str = "") -> str:
|
||||
return _H1.sub(lambda m: f"{m.group(1)}<p>{escape(line)}</p>{extra}", html, count=1)
|
||||
|
||||
|
||||
def _ranks(feed: Res_Feed, name: str) -> str:
|
||||
top = feed.bands.top5 if feed.bands else []
|
||||
return f"<h2>오늘 {escape(name)} 각 순위</h2><ol>{''.join(f'<li>{escape(t.name)} {t.score}점</li>' for t in top)}</ol>" if top else ""
|
||||
|
||||
|
||||
def fill(template: str, feed: Res_Feed, rows: list[WeatherHourly], name: str, sunset_at: Optional[datetime]) -> str:
|
||||
"""정적 지역 페이지에 오늘 값을 채운다: 설명 메타와 본문 첫 단락, 오늘 각 순위."""
|
||||
top = feed.bands.top5 if feed.bands else []
|
||||
ranks = f"<h2>오늘 {escape(name)} 각 순위</h2><ol>{''.join(f'<li>{escape(t.name)} {t.score}점</li>' for t in top)}</ol>" if top else ""
|
||||
return _put(template, today_line(feed, rows, sunset_at), ranks)
|
||||
return _put(template, today_line(feed, rows, sunset_at), _ranks(feed, name))
|
||||
|
||||
|
||||
class SeoService:
|
||||
@@ -115,7 +188,16 @@ class SeoService:
|
||||
sunset_at = sun_times(day, float(region.lat), float(region.lon)).sunset_at if region else None
|
||||
start = kst_midnight(day)
|
||||
_, rows = await DB_SESSION_MNG.execute_lambda(lambda s: self.weather.hourly_between(s, code, start, start + timedelta(days=1)))
|
||||
found = _NAME.search(template)
|
||||
name = found.group(1) if found else (feed.region_name or "")
|
||||
if path not in NEW_COPY:
|
||||
html = _put(template, tomorrow_line(rows or [], sunset_at)) if ahead else fill(template, feed, rows or [], name, sunset_at)
|
||||
return ErrorType.SUCCESS, _mark(html, "old")
|
||||
place = name.split(" ")[-1]
|
||||
if ahead:
|
||||
return ErrorType.SUCCESS, _put(template, tomorrow_line(rows or [], sunset_at))
|
||||
name = _NAME.search(template)
|
||||
return ErrorType.SUCCESS, fill(template, feed, rows or [], name.group(1) if name else (feed.region_name or ""), sunset_at)
|
||||
top1 = feed.hero.tomorrow.top1.name if feed.hero and feed.hero.tomorrow and feed.hero.tomorrow.top1 else None
|
||||
html = _put(template, tomorrow_copy(day, place, rows or [], top1, sunset_at))
|
||||
if top1:
|
||||
html = _retitle(html, f"{place} 내일 날씨 · 내일 1위는 {top1} | 날씨각")
|
||||
return ErrorType.SUCCESS, _mark(html, "new")
|
||||
return ErrorType.SUCCESS, _mark(_put(template, today_copy(day, place, feed, rows or [], sunset_at), _ranks(feed, name)), "new")
|
||||
@@ -30,7 +30,7 @@ from services.week_service import _icon
|
||||
# 주말 전국 날씨 순위·당일치기 추천. 대표 지역(노을 순위 30곳)과 당일치기 후보 도시의 토·일 나들이 점수를
|
||||
# 워커가 하루 두 번(06:40·18:40) 미리 계산해 Redis 에 둔다. 없으면 순위 API 가 그 자리에서 계산한다.
|
||||
_SEED = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "seed", "trip_city.csv")
|
||||
_KEY = "weekend_rank:v2:{:%Y%m%d}" # v2: 점수를 바꾸기 표로 보정한 값 (옛 점수 캐시를 쓰지 않게 키를 바꿨다)
|
||||
_KEY = "weekend_rank:v3:{:%Y%m%d}" # v3: 비 상한(최대 30점)을 없앤 점수 (옛 점수 캐시를 쓰지 않게 키를 바꿨다)
|
||||
_TTL = 13 * 3600
|
||||
_PARALLEL = 4 # 기상청 동시 호출 수
|
||||
_WAIT_STEPS, _WAIT_SEC = 60, 0.5
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import pytest
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
from config.settings import settings
|
||||
from router.router import app
|
||||
|
||||
KEY = "test-admin-key"
|
||||
pytestmark = pytest.mark.usefixtures("no_bot_comments")
|
||||
|
||||
|
||||
def client():
|
||||
return AsyncClient(transport=ASGITransport(app=app), base_url="http://test")
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_admin_users_needs_key(monkeypatch):
|
||||
monkeypatch.setattr(settings, "admin_api_key", KEY)
|
||||
async with client() as c:
|
||||
assert (await c.get("/v1/admin/users")).status_code == 401
|
||||
assert (await c.get("/v1/admin/users", headers={"X-Admin-Key": "wrong"})).status_code == 401
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_admin_users_lists_level_and_points(offline, monkeypatch):
|
||||
monkeypatch.setattr(settings, "admin_api_key", KEY)
|
||||
async with client() as c:
|
||||
body = (await c.post("/v1/auth/signup", json={"login_id": "adm_user1", "password": "password1", "nickname": "가짜닉"})).json()
|
||||
h = {"Authorization": f"Bearer {body['access_token']}"}
|
||||
await c.post("/v1/auth/terms", headers=h)
|
||||
await c.post("/v1/level/attend", headers=h)
|
||||
|
||||
res = (await c.get("/v1/admin/users", headers={"X-Admin-Key": KEY})).json()
|
||||
me = next(u for u in res["items"] if u["nickname"] == "가짜닉")
|
||||
assert me["provider"] == 1 and me["points"] == 10 and me["level"] == 1 and me["level_name"] == "이슬" and me["last_active"]
|
||||
assert "login_id" not in me and "birth_date" not in me
|
||||
assert res["counts"]["1"] >= 1 and res["total"] >= 1
|
||||
@@ -148,6 +148,8 @@ async def test_hero_tomorrow_and_tomorrow_slots(offline):
|
||||
async with client() as c:
|
||||
hero = (await c.get("/v1/feed", params={"region": REGION})).json()["hero"]
|
||||
assert set(hero["tomorrow"]["weather_slots"]) <= {"morning", "day", "evening", "night"}
|
||||
assert len(hero["tomorrow"]["ranked"]) <= 5 and len(hero["tomorrow"]["events"]) <= 3
|
||||
assert hero["tomorrow"]["top1"] == (hero["tomorrow"]["ranked"][0] if hero["tomorrow"]["ranked"] else None)
|
||||
res = (await c.get("/v1/weather/today", params={"region": REGION, "day": "tomorrow"})).json()
|
||||
assert res["day"] == hero["tomorrow"]["day"]
|
||||
|
||||
|
||||
@@ -85,3 +85,21 @@ def test_success_reads_toss_wrapper():
|
||||
toss_login._success(fail, "login-me")
|
||||
with pytest.raises(toss_login.TossLoginError, match="invalid_grant"):
|
||||
toss_login._success(grant, "generate-token")
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_toss_login_marks_only_first_as_new(monkeypatch):
|
||||
"""처음 들어온 요청만 is_new(GA sign_up), 같은 사람이 다시 들어오면 로그인"""
|
||||
import secrets
|
||||
|
||||
key = 10_000_000 + secrets.randbelow(80_000_000)
|
||||
|
||||
async def fake_user_key(code: str, referrer: str) -> int:
|
||||
return key
|
||||
|
||||
monkeypatch.setattr(toss_login, "user_key", fake_user_key)
|
||||
async with client() as c:
|
||||
first = (await c.post("/v1/auth/toss", json={"authorization_code": "code-x", "referrer": "DEFAULT"})).json()
|
||||
again = (await c.post("/v1/auth/toss", json={"authorization_code": "code-x", "referrer": "DEFAULT"})).json()
|
||||
assert first["result"]["success"] is True and first["is_new"] is True
|
||||
assert again["result"]["success"] is True and again["is_new"] is False
|
||||
@@ -195,6 +195,92 @@ def test_arrange_scatters_up_to_three_events_same_spot_all_day():
|
||||
assert run(14, "2026-10-02:1144000000") == out
|
||||
|
||||
|
||||
def test_feed_events_keeps_every_festival_and_two_of_other_kinds():
|
||||
from types import SimpleNamespace
|
||||
|
||||
from common.enums import EventKind
|
||||
from services.feed_service import feed_events
|
||||
from services.week_service import EventItem
|
||||
|
||||
kinds = [EventKind.POPUP] * 4 + [EventKind.FESTIVAL] * 6 + [EventKind.CONCERT] * 3 + [EventKind.EXHIBITION] * 3
|
||||
items = [EventItem(event=SimpleNamespace(kind=k.value, n=n), status="live", status_label="진행 중", fit=None) for n, k in enumerate(kinds)]
|
||||
out = [e.event.kind for e in feed_events(items)]
|
||||
assert out.count(EventKind.FESTIVAL.value) == 6
|
||||
assert all(out.count(k.value) == 2 for k in (EventKind.POPUP, EventKind.CONCERT, EventKind.EXHIBITION))
|
||||
assert out[:4] == [EventKind.FESTIVAL.value, EventKind.POPUP.value, EventKind.EXHIBITION.value, EventKind.CONCERT.value]
|
||||
|
||||
|
||||
def test_tomorrow_events_keep_same_sido_events_running_that_day():
|
||||
"""내일 페이지 행사: 내일 열리는 같은 시도 행사만, 종류를 섞어 3개까지."""
|
||||
from types import SimpleNamespace
|
||||
|
||||
from common.enums import EventKind
|
||||
from services.feed_service import tomorrow_events
|
||||
from services.week_service import EventItem
|
||||
|
||||
day = date(2026, 10, 31)
|
||||
|
||||
def ev(n, kind, sido="11", start=day, end=day):
|
||||
e = SimpleNamespace(event_id=n, name=f"행사{n}", place_name=f"장소{n}", icon="concert", kind=kind.value, sido_code=sido, start_date=start, end_date=end)
|
||||
return EventItem(event=e, status="live", status_label="진행 중", fit=None)
|
||||
|
||||
items = [
|
||||
ev(1, EventKind.CONCERT), ev(2, EventKind.CONCERT), ev(3, EventKind.FESTIVAL, start=day - timedelta(days=2)),
|
||||
ev(4, EventKind.FESTIVAL, end=day - timedelta(days=1)), ev(5, EventKind.EXHIBITION, sido="41"), ev(6, EventKind.POPUP, start=day + timedelta(days=1)),
|
||||
]
|
||||
out = tomorrow_events(items, "1144000000", day)
|
||||
assert [e.event_id for e in out] == [3, 1, 2]
|
||||
assert out[0].place == "장소3" and out[0].start_date == day - timedelta(days=2)
|
||||
|
||||
|
||||
def test_hero_tomorrow_ranks_in_season_gak_by_tomorrow_score():
|
||||
"""내일의 각: 내일 하루 점수(중요도 반영) 순 5개, 철 지난 각은 빼고, 1위는 top1 과 같다."""
|
||||
from types import SimpleNamespace
|
||||
|
||||
from services.feed_service import _hero_tomorrow
|
||||
|
||||
day = date(2026, 10, 31)
|
||||
|
||||
def item(n, score, in_season=True, priority=1.0):
|
||||
d = SimpleNamespace(index_id=n, code=f"g{n}", name=f"각{n}", icon="sun", priority=priority)
|
||||
trend = [SimpleNamespace(score_date=day - timedelta(days=1), score=100, summary="오늘"), SimpleNamespace(score_date=day, score=score, summary=f"내일{n}")]
|
||||
return SimpleNamespace(definition=d, trend=trend, in_season=in_season)
|
||||
|
||||
board = SimpleNamespace(items=[item(1, 60), item(2, 99, in_season=False), item(3, 90), item(4, 70), item(5, 80), item(6, 50), item(7, 40)],
|
||||
tomorrow_slots={}, tomorrow_why={})
|
||||
hero = _hero_tomorrow(day, board)
|
||||
assert [(g.index_id, g.rank) for g in hero.ranked] == [(3, 1), (5, 2), (4, 3), (1, 4), (6, 5)]
|
||||
assert hero.top1 == hero.ranked[0] and hero.ranked[0].summary == "내일3"
|
||||
|
||||
|
||||
def test_arrange_spreads_many_events_through_whole_feed():
|
||||
"""행사가 앞쪽 절반 자리보다 많으면 끝까지 한 장씩 걸러 끼우고, 남은 건 맨 뒤에 다 붙인다."""
|
||||
from datetime import datetime
|
||||
|
||||
from common.utils.kma_time import KST
|
||||
from services.feed_service import arrange
|
||||
|
||||
sunset = datetime(2026, 10, 2, 18, 10, tzinfo=KST)
|
||||
others = [PostType.WEATHER, PostType.GAK, PostType.GAK, PostType.GAK, PostType.SUNSET, PostType.WEEK, PostType.SEASON, PostType.TIP, PostType.QUOTE]
|
||||
cards = [_card(t, n) for n, t in enumerate(others + [PostType.EVENT] * 20)]
|
||||
out = arrange(cards, "day", datetime(2026, 10, 2, 13, tzinfo=KST), sunset, False, "2026-10-02:1144000000")
|
||||
types = [c.post_type for c in out]
|
||||
assert types.count(PostType.EVENT) == 20 and types[0] is PostType.WEATHER
|
||||
rest = len(others) - 1
|
||||
assert PostType.EVENT not in types[1:1 + 2 * rest:2] and types[2:2 + 2 * rest:2] == [PostType.EVENT] * rest
|
||||
assert set(types[1 + 2 * rest:]) == {PostType.EVENT}
|
||||
assert [c.post_id for c in out if c.post_type is PostType.EVENT] == list(range(len(others), len(others) + 20))
|
||||
|
||||
|
||||
def test_lineup_event_slots_stay_below_card_positions():
|
||||
from crud.card_crud import CARD_POSITION_START
|
||||
from services.feed_service import LINEUP, _EVENT_SLOTS
|
||||
|
||||
positions = [x[0] for x in LINEUP]
|
||||
assert len(positions) == len(set(positions)) and max(positions) < CARD_POSITION_START
|
||||
assert sorted(x[3] for x in LINEUP if x[1] is PostType.EVENT) == list(range(1, _EVENT_SLOTS + 1))
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_build_day_makes_every_card_at_three():
|
||||
thursday = date(2026, 10, 15)
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
from datetime import date, timedelta
|
||||
|
||||
import pytest
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
import services.first_snow_service as first_snow_service
|
||||
from common.utils.kma_time import now_kst
|
||||
from router.router import app
|
||||
from services.external.open_meteo import OpenMeteoRequestFailed, parse_snow
|
||||
from services.first_snow_service import SPOTS, first_snow_day
|
||||
|
||||
|
||||
def _daily(start: date, cms: list) -> dict:
|
||||
return {"daily": {"time": [(start + timedelta(days=i)).isoformat() for i in range(len(cms))], "snowfall_sum": cms}}
|
||||
|
||||
|
||||
def test_parse_snow_skips_days_without_value():
|
||||
rows = parse_snow(_daily(date(2026, 11, 20), [0.0, None, 1.4]))
|
||||
assert rows == [(date(2026, 11, 20), 0.0), (date(2026, 11, 22), 1.4)]
|
||||
|
||||
|
||||
def test_first_snow_day_is_first_day_from_today_with_enough_snow():
|
||||
today = date(2026, 11, 22)
|
||||
days = [(date(2026, 11, 21), 3.0), (date(2026, 11, 22), 0.05), (date(2026, 11, 24), 0.7), (date(2026, 11, 25), 2.0)]
|
||||
assert first_snow_day(days, today) == (date(2026, 11, 24), 0.7) # 어제 눈과 0에 가까운 값은 뺀다
|
||||
assert first_snow_day([(date(2026, 11, 23), 0.0)], today) is None
|
||||
|
||||
|
||||
def test_spot_data_has_normal_dates_and_unique_names():
|
||||
names = [s["name"] for s in SPOTS]
|
||||
assert len(names) == len(set(names)) and len(names) >= 40
|
||||
for s in SPOTS:
|
||||
month, day = map(int, s["normal"].split("-"))
|
||||
assert month in (11, 12) and 1 <= day <= 31
|
||||
assert 33 <= s["lat"] <= 39 and 125 <= s["lon"] <= 130
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_first_snow_api_marks_spots_with_snow_forecast(monkeypatch):
|
||||
today = now_kst().date()
|
||||
calls = []
|
||||
|
||||
async def fake_fetch(client, points, days):
|
||||
calls.append(len(points))
|
||||
# 첫 지점만 모레 눈, 나머지는 눈 없음
|
||||
return [_daily(today, [0.0, 0.0, 1.2, 0.0] if i == 0 else [0.0] * 4) for i in range(len(points))]
|
||||
|
||||
monkeypatch.setattr(first_snow_service, "fetch_snow", fake_fetch)
|
||||
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
|
||||
body = (await client.get("/v1/season/first-snow")).json()
|
||||
again = (await client.get("/v1/season/first-snow")).json()
|
||||
assert body["result"]["success"] is True and body["forecast"] is True
|
||||
assert len(body["spots"]) == len(SPOTS)
|
||||
first = body["spots"][0]
|
||||
assert first["name"] == SPOTS[0]["name"] and first["normal"] == SPOTS[0]["normal"]
|
||||
assert first["snow_date"] == (today + timedelta(days=2)).isoformat() and first["snow_cm"] == 1.2
|
||||
assert all("snow_date" not in s for s in body["spots"][1:])
|
||||
assert again == body and calls == [len(SPOTS)] # 두 번째는 Redis 에 둔 예보를 쓴다
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_first_snow_api_returns_normal_dates_when_forecast_fails(monkeypatch):
|
||||
async def failing_fetch(client, points, days):
|
||||
raise OpenMeteoRequestFailed("down")
|
||||
|
||||
monkeypatch.setattr(first_snow_service, "fetch_snow", failing_fetch)
|
||||
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
|
||||
body = (await client.get("/v1/season/first-snow")).json()
|
||||
assert body["result"]["success"] is True and body["forecast"] is False
|
||||
assert len(body["spots"]) == len(SPOTS) and all("snow_date" not in s for s in body["spots"])
|
||||
@@ -68,6 +68,18 @@ def test_time_matching_does_not_replace_weekday_score():
|
||||
assert evaluate(_defn(), [[_h(12)]], replace(CTX, time_matches=False)).factors["time"] == 100
|
||||
|
||||
|
||||
def test_time_mismatch_cap_only_applies_outside_activity_hours():
|
||||
limit = [{"field": "time_matches", "op": "==", "value": False, "cap": 50}]
|
||||
defn = _defn(factor_rules=_defn().factor_rules | {"time": {"type": "fixed", "value": 100}}, zero_rules=limit)
|
||||
matched = evaluate(defn, [[_h(7, wind=1.0)]], CTX)
|
||||
unmatched = evaluate(defn, [[_h(12, wind=1.0)]], replace(CTX, time_matches=False))
|
||||
assert matched.score == 100 and matched.zero_reason is None
|
||||
assert unmatched.score == 50 and unmatched.zero_reason == "활동 시간대가 아니라 최대 50점"
|
||||
assert zero_rules_text(limit) == "활동 시간대가 아니면 최대 50점"
|
||||
assert zero_rules_text(limit + [{"field": "rain_prob", "op": ">=", "value": 60, "cap": 50}]) == \
|
||||
"활동 시간대가 아니거나 비 확률 60% 이상이면 최대 50점"
|
||||
|
||||
|
||||
def test_good_but_not_perfect_stays_below_100():
|
||||
assert evaluate(_defn(), [[_h(19, feels=23, hum=58, wind=1.8)]], CTX).score < 95
|
||||
|
||||
@@ -240,10 +252,20 @@ def test_outing_cloudy_and_hot_days_lose_points():
|
||||
assert "흐림" in cloudy.reason
|
||||
|
||||
|
||||
def test_outing_rain_caps_score():
|
||||
r = outing(_day(prob=70))
|
||||
assert r.score <= 30 and r.capped
|
||||
assert outing([_h(10, prob=30, rain=RainType.RAIN)] + _day()[1:]).score <= 30
|
||||
def test_outing_rain_lowers_score_without_a_cap():
|
||||
"""비가 오면 비 점수와 가장 낮은 요소 때문에 점수가 내려가지만, 따로 상한으로 묶지는 않는다."""
|
||||
clear = outing(_day())
|
||||
likely = outing(_day(prob=70))
|
||||
raining = outing([_h(10, prob=30, rain=RainType.RAIN)] + _day()[1:])
|
||||
assert raining.score < likely.score < clear.score
|
||||
assert likely.score > 30 and raining.score > 30
|
||||
|
||||
|
||||
def test_outing_rainy_days_keep_their_differences():
|
||||
"""전국이 비인 날에도 기온·하늘에 따라 점수가 갈린다 (예전엔 모두 상한 30점에 걸려 같은 점수였다)."""
|
||||
mild = outing(_day(feels=16.0, sky=Sky.CLOUDY, rain=RainType.RAIN))
|
||||
chilly = outing(_day(feels=14.0, sky=Sky.CLOUDY, rain=RainType.RAIN))
|
||||
assert chilly.score < mild.score
|
||||
|
||||
|
||||
def test_outing_needs_all_hours():
|
||||
@@ -254,7 +276,7 @@ def test_outing_estimate_from_mid_forecast():
|
||||
r = outing_estimate(_fc(lo=12, hi=22, am=10, pm=20))
|
||||
assert r.estimated is True and r.factors["wind"] == 70
|
||||
assert r.reason.startswith("비 20% · 낮 ")
|
||||
assert outing_estimate(_fc(pm=60)).score <= 30
|
||||
assert 30 < outing_estimate(_fc(pm=60)).score < outing_estimate(_fc(pm=0)).score
|
||||
assert outing_estimate(_fc(lo=None, hi=None)) is None
|
||||
|
||||
|
||||
@@ -275,6 +297,85 @@ def _seed_score(code, day=_SAT, pm25=10, **hour):
|
||||
return evaluate(d, windows, replace(CTX, day=day, pm25=pm25)).score
|
||||
|
||||
|
||||
@pytest.mark.parametrize("prob, ceiling", [(60, 30), (69, 30), (70, 0)])
|
||||
def test_running_high_rain_probability_limits_score(prob, ceiling):
|
||||
assert _seed_score("running", feels=12, prob=prob) <= ceiling
|
||||
|
||||
|
||||
@pytest.mark.parametrize("rain", [RainType.RAIN, RainType.SNOW, RainType.SLEET])
|
||||
def test_running_any_precipitation_in_window_is_zero(rain):
|
||||
hours = [_h(6, feels=12), _h(7, feels=12, prob=10, rain=rain)]
|
||||
result = evaluate(_SEED["running"], [hours], CTX)
|
||||
assert result.score == 0 and result.zero_reason == "비 소식이 있어 0점"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("feels, ceiling", [(-3, 0), (0, 40), (2, 40), (3, 40), (4.9, 40), (28, 30), (35, 0)])
|
||||
def test_running_cold_and_heat_limit_score(feels, ceiling):
|
||||
assert _seed_score("running", feels=feels) <= ceiling
|
||||
|
||||
|
||||
def test_running_cold_limit_uses_coldest_hour():
|
||||
hours = [_h(6, feels=3), _h(7, feels=12)]
|
||||
assert evaluate(_SEED["running"], [hours], CTX).score <= 40
|
||||
|
||||
|
||||
@pytest.mark.parametrize("hour", [6, 7, 19, 21])
|
||||
@pytest.mark.parametrize("feels", [5, 8, 10, 12, 15])
|
||||
def test_running_clear_cool_morning_and_evening_stay_good(hour, feels):
|
||||
result = evaluate(_SEED["running"], [[_h(hour, feels=feels)]], CTX)
|
||||
assert result.score >= 80 and result.zero_reason is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize("hour, feels", [(12, 12), (12, 14), (12, 25), (22, 12), (26, 12)])
|
||||
def test_running_outside_activity_hours_stays_low(hour, feels):
|
||||
result = evaluate(_SEED["running"], [[_h(hour, feels=feels)]], replace(CTX, time_matches=False))
|
||||
assert result.factors["time"] == 0 and result.score <= 50
|
||||
|
||||
|
||||
@pytest.mark.parametrize("wind, ceiling", [(6, 30), (8, 0)])
|
||||
def test_running_strong_wind_limits_score(wind, ceiling):
|
||||
assert _seed_score("running", feels=12, wind=wind) <= ceiling
|
||||
|
||||
|
||||
def test_running_strong_gust_is_zero():
|
||||
assert _seed_score("running", feels=12, gust_ms=15) == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize("pm25, ceiling", [(36, 30), (75, 0)])
|
||||
def test_running_bad_air_limits_score(pm25, ceiling):
|
||||
assert _seed_score("running", feels=12, pm25=pm25) <= ceiling
|
||||
|
||||
|
||||
def test_running_wind_warning_is_zero():
|
||||
assert evaluate(_SEED["running"], [[_h(6, feels=12)]], replace(CTX, wind_warning=True)).score == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize("hour", [dict(prob=60, feels=3), dict(prob=60, feels=35), dict(prob=60, wind=8)])
|
||||
@pytest.mark.parametrize("time_matches", [True, False])
|
||||
def test_running_stricter_limits_win_when_conditions_overlap(hour, time_matches):
|
||||
result = evaluate(_SEED["running"], [[_h(6, **(dict(feels=12) | hour))]], replace(CTX, time_matches=time_matches))
|
||||
assert result.score <= (30 if hour.get("feels") == 3 else 0)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("time_matches", [True, False])
|
||||
@pytest.mark.parametrize("hour", [dict(feels=12), dict(feels=20, hum=80), dict(feels=3, prob=60), dict(feels=12, wind=8, rain=RainType.RAIN)])
|
||||
def test_other_definitions_ignore_unused_time_match_condition(time_matches, hour):
|
||||
from unittest.mock import patch
|
||||
|
||||
from services.calc import index_calc
|
||||
|
||||
ctx = replace(CTX, time_matches=time_matches, pm25=30)
|
||||
windows = [[_h(7, **hour)]]
|
||||
zero = index_calc._zero
|
||||
for code, defn in _SEED.items():
|
||||
if code == "running":
|
||||
continue
|
||||
assert all(r["field"] != "time_matches" for r in defn.zero_rules)
|
||||
actual = evaluate(defn, windows, ctx)
|
||||
with patch.object(index_calc, "_zero", side_effect=lambda rules, agg: zero(rules, {k: v for k, v in agg.items() if k != "time_matches"})):
|
||||
assert actual == evaluate(defn, windows, ctx), code
|
||||
|
||||
|
||||
@pytest.mark.parametrize("code, good, bad", [
|
||||
("golf", dict(feels=19.0, wind=2.0, hum=45), dict(feels=18.0, prob=80, rain=RainType.RAIN)),
|
||||
("jipkok", dict(feels=4.0, prob=90, rain=RainType.RAIN, wind=7.0, hum=85), dict(feels=20.0, wind=1.0, hum=40)),
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import json
|
||||
from dataclasses import replace
|
||||
from datetime import date, timedelta
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
|
||||
from common.enums import RainType, Sky
|
||||
from common.utils.kma_time import kst_midnight
|
||||
from services.calc.index_calc import Context, DayForecast
|
||||
from services.index_service import day_result, slot_days, slot_label
|
||||
from services.index_service import day_result, slot_days, slot_label, slot_results
|
||||
|
||||
REGION = SimpleNamespace(lat=37.56, lon=126.97)
|
||||
SAT = date(2026, 10, 10)
|
||||
@@ -18,6 +21,7 @@ DEFN = SimpleNamespace(
|
||||
zero_rules=[], windows=[{"from": 11, "to": 16}],
|
||||
)
|
||||
FC = {SAT: DayForecast(temp_min_c=12, temp_max_c=22, rain_prob_am=10, rain_prob_pm=20, sky=Sky.CLEAR)}
|
||||
RUNNING = SimpleNamespace(**next(x for x in json.loads((Path(__file__).parents[1] / "seed" / "index_definition.json").read_text(encoding="utf-8")) if x["code"] == "running"))
|
||||
|
||||
|
||||
def _hourly(day: date) -> dict:
|
||||
@@ -71,3 +75,48 @@ def test_partial_hourly_falls_back_to_estimate():
|
||||
|
||||
def test_no_mid_forecast_gives_no_score():
|
||||
assert day_result(DEFN, SAT, REGION, {}, {}, CTX, short=False) is None
|
||||
|
||||
|
||||
def test_running_slot_rain_outside_activity_hours_still_zero():
|
||||
start = kst_midnight(SAT)
|
||||
hourly = _hourly(SAT)
|
||||
for row in hourly.values():
|
||||
row.feels_c = 12
|
||||
hourly[start + timedelta(hours=9)].rain_type = RainType.RAIN.value
|
||||
results = slot_results(RUNNING, SAT, REGION, hourly, {}, CTX, start + timedelta(hours=18))
|
||||
assert results["morning"].score == 0
|
||||
assert results["morning"].zero_reason == "비 소식이 있어 0점"
|
||||
assert results["night"].score >= 80
|
||||
|
||||
|
||||
def test_running_slots_lower_day_and_late_night_but_keep_activity_hours():
|
||||
start = kst_midnight(SAT)
|
||||
hourly = _hourly(SAT) | _hourly(SAT + timedelta(days=1))
|
||||
for row in hourly.values():
|
||||
row.feels_c = 25 if 11 <= row.forecast_at.hour < 16 else 12
|
||||
sunset = start + timedelta(hours=18)
|
||||
results = slot_results(RUNNING, SAT, REGION, hourly, {}, CTX, sunset)
|
||||
assert results["morning"].score >= 80 and results["night"].score >= 80
|
||||
assert results["day"].score <= 50 and results["early"].score <= 50
|
||||
late = slot_results(RUNNING, SAT, REGION, hourly, {}, CTX, sunset, now=start + timedelta(hours=22))
|
||||
assert late["night"].factors["time"] == 0 and late["night"].score <= 50
|
||||
|
||||
|
||||
def test_running_muggy_morning_does_not_exceed_original_weather_score():
|
||||
start = kst_midnight(SAT)
|
||||
hourly = _hourly(SAT)
|
||||
for row in hourly.values():
|
||||
row.feels_c, row.humidity, row.wind_ms = 20, 80, 1.5
|
||||
results = slot_results(RUNNING, SAT, REGION, hourly, {}, replace(CTX, pm25=30), start + timedelta(hours=18))
|
||||
assert results["morning"].factors["time"] == 100
|
||||
assert results["morning"].score <= 67
|
||||
|
||||
|
||||
def test_now_slot_summary_shows_current_hour_not_middle_of_rest():
|
||||
"""오후 4시 10분이면 지금 구간 줄은 남은 16~18시의 가운데(5시)가 아니라 지금(4시) 날씨로."""
|
||||
start = kst_midnight(SAT)
|
||||
hourly = _hourly(SAT) | _hourly(SAT + timedelta(days=1))
|
||||
sunset = start + timedelta(hours=17, minutes=30)
|
||||
results = slot_results(RUNNING, SAT, REGION, hourly, {}, CTX, sunset, now=start + timedelta(hours=16, minutes=10))
|
||||
assert results["evening"].summary.startswith("오후 4시"), results["evening"].summary
|
||||
assert results["night"].summary.startswith("오후 4시") is False
|
||||
@@ -25,7 +25,7 @@ def test_calibrated_outing_reads_the_table():
|
||||
|
||||
def test_day_score_uses_calibrated_value_for_hourly_and_estimated_results():
|
||||
for estimated in (False, True):
|
||||
r = Outing(score=80, factors={}, notes={}, reason="비 0% · 체감 21° · 맑음", capped=False, estimated=estimated)
|
||||
r = Outing(score=80, factors={}, notes={}, reason="비 0% · 체감 21° · 맑음", estimated=estimated)
|
||||
assert outing_day_score(r) == OUTING_SCORE_TABLE[80]
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ async def test_reading_for_anyone_gives_me_today_and_cards(offline):
|
||||
r = (await c.post("/v1/saju/reading", json=BIRTH)).json()
|
||||
assert [p["stem"] + p["branch"] for p in r["me"]["pillars"]] == ["乙亥", "己卯", "甲辰"] and r["me"]["hour_known"] is False
|
||||
assert r["me"]["scene"].endswith("기운") and r["today"]["title"] and 0 <= r["today"]["score"] <= 100
|
||||
assert [(p.get("stem_ten_god"), p["branch_ten_god"]) for p in r["me"]["pillars"]] == [("겁재", "편인"), ("정재", "겁재"), (None, "편재")]
|
||||
assert r["me"]["top_element"] == "木" and r["me"]["strong"] is True and r["me"]["strength"] == "신강" and r["me"]["elements"]["木"] == 58.3
|
||||
kinds = [x["kind"] for x in r["today"]["cards"]]
|
||||
assert "when" in kinds and "do" in kinds and "wear" in kinds
|
||||
# 근거 줄은 쉬운 말 + 괄호 용어, 숫자 없이
|
||||
|
||||
@@ -4,13 +4,14 @@ import pytest
|
||||
|
||||
from common.utils.kma_time import KST
|
||||
from services.saju.birth import to_solar_time
|
||||
from services.saju.climate import HourWeather, axis_effect, chart_climate, climate_match
|
||||
from services.saju.climate import HourWeather, axis_effect, chart_climate, climate_match, seasoned
|
||||
from services.saju.daily import SCORE_WEIGHTS, daily_facts
|
||||
from services.saju.pillars import day_pillar, make_chart
|
||||
from services.saju.rules import (
|
||||
branch_relations, branch_ten_god, chart_ten_gods, dohwa_of, hongyeom_of, stem_relations, ten_god, triple_relations,
|
||||
)
|
||||
from services.saju.solar_terms import JEOL, jeol_of_year, nutation_longitude, sun_apparent_longitude
|
||||
from services.saju.strength import chart_strength
|
||||
|
||||
EXAMPLE = make_chart(date(1995, 3, 14))
|
||||
|
||||
@@ -254,6 +255,33 @@ def test_example_chart_climate_and_best_window():
|
||||
assert moist == {"axis": "moist", "need": "dry", "effect": "dries", "helps": True, "points": moist["points"], "weather": "체감 13°, 습도 40%"}
|
||||
|
||||
|
||||
|
||||
def test_example_strength_counts_hidden_stems_and_month_branch():
|
||||
s = chart_strength(EXAMPLE) # 乙亥 己卯 甲辰
|
||||
assert s.elements == {"木": 58.3, "火": 0.0, "土": 24.3, "金": 0.0, "水": 7.3}
|
||||
assert s.top == "木" and s.strong and s.support == 0.696
|
||||
|
||||
|
||||
def test_summer_earth_chart_reads_hot_and_dry_not_rainy():
|
||||
chart = make_chart(date(1959, 7, 16)) # 己亥 辛未 己亥: 未월 토가 많고 물이 둘
|
||||
climate = chart_climate(chart)
|
||||
assert climate.season == "여름" and climate.label == "따뜻·마름" and climate.need["temp"] == "cool"
|
||||
assert climate.strength.top == "土" and climate.strength.strong
|
||||
|
||||
|
||||
def test_month_rooted_day_master_stays_strong_whatever_the_hour():
|
||||
# 未월 己土는 득령(월령 土) — 시주가 물·쇠라도 신강, 득령 없는 같은 몫이면 낮게
|
||||
for h in range(0, 24, 2):
|
||||
s = chart_strength(make_chart(date(1959, 7, 16), time(h, 30)))
|
||||
assert s.deuk_ryeong and s.label == "신강", (h, s)
|
||||
winter = chart_strength(make_chart(date(1959, 12, 20))) # 子월 — 己土 득령 아님
|
||||
assert not winter.deuk_ryeong
|
||||
|
||||
|
||||
def test_month_dries_summer_earth_and_soaks_winter_earth():
|
||||
assert seasoned("己", "未")[1] < 0 < seasoned("己", "子")[1]
|
||||
assert seasoned("壬", "未")[0] > seasoned("壬", "子")[0]
|
||||
|
||||
def test_balanced_axis_prefers_mild_weather_and_rain_moistens():
|
||||
assert axis_effect(0.0, 0.0) > axis_effect(0.0, 0.6) and axis_effect(0.0, 0.0) > axis_effect(0.0, -0.6)
|
||||
assert axis_effect(-0.4, 0.8) > axis_effect(-0.4, 0.0) > axis_effect(-0.4, -0.8)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from datetime import datetime
|
||||
from datetime import date, datetime
|
||||
|
||||
import pytest
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
@@ -7,7 +7,8 @@ from common.utils.kma_time import KST
|
||||
from common.database.model.models import WeatherHourly
|
||||
from router.router import app
|
||||
from router.v1.feed.protocol import Bands, Hero, HeroStat, Res_Feed, TopIndex
|
||||
from services.seo_service import SeoService, day_summary, fill, today_line, tomorrow_line
|
||||
from services import seo_service
|
||||
from services.seo_service import SeoService, day_summary, fill, today_copy, today_line, tomorrow_copy, tomorrow_line
|
||||
|
||||
REGION = "1114000000"
|
||||
TEMPLATE = (
|
||||
@@ -55,6 +56,7 @@ def test_fill_keeps_template_when_no_weather():
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_today_page_fills_real_feed(offline, monkeypatch):
|
||||
monkeypatch.setattr(seo_service, "NEW_COPY", frozenset())
|
||||
async def template(self, path):
|
||||
return TEMPLATE if path == "today/seoul/jung" else None
|
||||
|
||||
@@ -69,6 +71,7 @@ async def test_today_page_fills_real_feed(offline, monkeypatch):
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_gu_page_of_city_has_its_own_address(offline, monkeypatch):
|
||||
monkeypatch.setattr(seo_service, "NEW_COPY", frozenset())
|
||||
async def template(self, path):
|
||||
return TEMPLATE if path == "today/gyeonggi/seongnam/bundang" else None
|
||||
|
||||
@@ -86,6 +89,7 @@ def test_tomorrow_line_has_day_and_sunset():
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_tomorrow_page_fills_tomorrow_forecast(offline, monkeypatch):
|
||||
monkeypatch.setattr(seo_service, "NEW_COPY", frozenset())
|
||||
tmpl = TEMPLATE.replace("오늘 날씨", "내일 날씨")
|
||||
|
||||
async def template(self, path):
|
||||
@@ -98,3 +102,67 @@ async def test_tomorrow_page_fills_tomorrow_forecast(offline, monkeypatch):
|
||||
assert page.status_code == 200 and "<h1>서울 중구 내일 날씨, 뭐 할까?</h1><p>최저 " in page.text
|
||||
assert "지금 " not in page.text and "<ol>" not in page.text
|
||||
assert missing.status_code == 404
|
||||
|
||||
|
||||
def test_today_copy_has_date_place_morning_day_firsts_and_status():
|
||||
line = today_copy(date(2026, 10, 14), "중구", _feed(), [_hour(12, 19.5, prob=10)], datetime(2026, 10, 14, 17, 52, tzinfo=KST))
|
||||
assert line == "10월 14일(수) 중구 오늘 날씨: 최저 20°·최고 20°, 비 올 확률 10%. 아침엔 러닝각, 낮엔 빨래각이 1위예요. 미세먼지 좋음, 해 지는 시각 오후 5시 52분."
|
||||
same = _feed()
|
||||
same.stories = [_top("캠핑각", 90, {"morning": 1, "day": 1})]
|
||||
assert "아침·낮엔 캠핑각이 1위예요." in today_copy(date(2026, 10, 14), "중구", same, [], None)
|
||||
|
||||
|
||||
def test_today_copy_lists_dust_discomfort_uv_in_order():
|
||||
feed = _feed()
|
||||
feed.hero.status = [HeroStat(icon="m", label=label, value=value, tone="normal") for label, value in (("습도", "보통"), ("불쾌지수", "쾌적"), ("자외선", "보통"), ("미세먼지", "보통"))]
|
||||
line = today_copy(date(2026, 10, 30), "성남시", feed, [_hour(12, 18, rain=2, prob=60)], None)
|
||||
assert line.endswith("미세먼지 보통, 불쾌지수 쾌적, 자외선 보통.")
|
||||
assert "습도" not in line
|
||||
|
||||
|
||||
def test_tomorrow_copy_has_date_place_top1_and_sunset():
|
||||
sunset = datetime(2026, 10, 31, 17, 36, tzinfo=KST)
|
||||
line = tomorrow_copy(date(2026, 10, 31), "평택시", [_hour(12, 15, prob=30)], "빨래각", sunset)
|
||||
assert line == "10월 31일(토) 평택시 내일 날씨: 최저 15°·최고 15°, 맑음, 비 올 확률 30%. 내일 하기 좋은 일 1위는 빨래각, 해 지는 시각은 오후 5시 36분이에요."
|
||||
on_hour = tomorrow_copy(date(2026, 10, 31), "평택시", [_hour(12, 15)], None, datetime(2026, 10, 31, 18, 0, tzinfo=KST))
|
||||
assert on_hour.endswith("해 지는 시각은 오후 6시예요.")
|
||||
assert tomorrow_copy(date(2026, 10, 31), "평택시", [], "빨래각", sunset) == ""
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_new_copy_pages_get_new_title_and_description(offline, monkeypatch):
|
||||
tomorrow = TEMPLATE.replace("오늘 날씨", "내일 날씨").replace("</head>", "<title>중구 내일 날씨, 뭐 할까? · 서울 | 날씨각</title></head>")
|
||||
|
||||
async def template(self, path):
|
||||
return {"today/seoul/jung": TEMPLATE, "tomorrow/seoul/jung": tomorrow}.get(path)
|
||||
|
||||
monkeypatch.setattr(SeoService, "template", template)
|
||||
monkeypatch.setattr(seo_service, "NEW_COPY", frozenset({"today/seoul/jung", "tomorrow/seoul/jung"}))
|
||||
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
|
||||
today = await client.get("/v1/seo/today/seoul/jung")
|
||||
ahead = await client.get("/v1/seo/tomorrow/seoul/jung")
|
||||
assert today.status_code == 200 and ahead.status_code == 200
|
||||
assert '<meta name="description" content="10월 ' in today.text and " 중구 오늘 날씨: 최저 " in today.text
|
||||
assert "<ol><li>" in today.text and '<meta name="seo-copy" content="new" />' in today.text
|
||||
assert " 중구 내일 날씨: 최저 " in ahead.text and "해 지는 시각은 오후" in ahead.text
|
||||
assert "<title>중구 내일 날씨 · 내일 1위는 " in ahead.text and 'property="og:description" content="10월 ' in ahead.text
|
||||
assert '<meta name="seo-copy" content="new" />' in ahead.text
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_old_copy_pages_keep_old_text_and_are_marked(offline, monkeypatch):
|
||||
async def template(self, path):
|
||||
return TEMPLATE if path == "today/seoul/jung" else None
|
||||
|
||||
monkeypatch.setattr(SeoService, "template", template)
|
||||
monkeypatch.setattr(seo_service, "NEW_COPY", frozenset())
|
||||
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
|
||||
page = await client.get("/v1/seo/today/seoul/jung")
|
||||
assert "<h1>서울 중구 오늘 날씨, 뭐 할까?</h1><p>최저 " in page.text
|
||||
assert '<meta name="seo-copy" content="old" />' in page.text
|
||||
|
||||
|
||||
def test_copy_test_groups_split_region_pages_in_half():
|
||||
assert seo_service.NEW_COPY and all(p.startswith(("today/", "tomorrow/")) for p in seo_service.NEW_COPY)
|
||||
today = sum(p.startswith("today/") for p in seo_service.NEW_COPY)
|
||||
assert today == len(seo_service.NEW_COPY) - today
|
||||
@@ -82,6 +82,32 @@ async def test_reports_hide_and_block_hides_author():
|
||||
assert t["talk_id"] not in [x["talk_id"] for x in (await c.get("/v1/talk/list")).json()["talks"]]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_talk_comments_need_login_and_keep_count_on_talk():
|
||||
async with client() as c:
|
||||
h = await _login(c, "talk_c1")
|
||||
t = (await _write(c, h))["talk"]
|
||||
url = f"/v1/reaction/talk/{t['talk_id']}/comment"
|
||||
count = lambda talks: next(x for x in talks if x["talk_id"] == t["talk_id"])["comment_count"] # noqa: E731
|
||||
assert (await c.post(url, json={"body": "저도 봤어요"})).status_code == 401
|
||||
other = await _login(c, "talk_c2")
|
||||
assert (await c.post(url, headers=other, json={"body": "저도 봤어요"})).json()["result"]["desc"] == "TERMS_REQUIRED"
|
||||
await c.post("/v1/auth/terms", headers=other)
|
||||
assert (await c.post(url, headers=other, json={"body": "연락 010-1234-5678"})).json()["result"]["desc"] == "LINK_NOT_ALLOWED"
|
||||
assert (await c.post(url, headers=other, json={"body": "가" * 61})).json()["result"]["desc"] == "INVALID_INPUT"
|
||||
|
||||
made = (await c.post(url, headers=other, json={"body": " 저도 봤어요 "})).json()["comment"]
|
||||
assert made["body"] == "저도 봤어요" and made["mine"] is True
|
||||
listed = (await c.get(f"{url}/list")).json()["comments"]
|
||||
assert [x["comment_id"] for x in listed] == [made["comment_id"]] and listed[0]["nickname"] == "talk_c2"
|
||||
assert count((await c.get("/v1/talk/list")).json()["talks"]) == 1
|
||||
|
||||
assert (await c.delete(f"/v1/reaction/comment/{made['comment_id']}", headers=other)).json()["result"]["success"] is True
|
||||
assert (await c.get(f"{url}/list")).json()["comments"] == []
|
||||
assert count((await c.get("/v1/talk/list")).json()["talks"]) == 0
|
||||
assert (await c.post("/v1/reaction/talk/999999999/comment", headers=other, json={"body": "안녕"})).json()["result"]["desc"] == "NOT_FOUND"
|
||||
|
||||
|
||||
def test_weather_line():
|
||||
class Row:
|
||||
temp_c, sky, rain_type = 18.4, 1, 1
|
||||
|
||||
@@ -17,6 +17,12 @@ if [ -z "${DEPLOY_PULLED:-}" ]; then
|
||||
fi
|
||||
docker compose up -d --wait postgres redis
|
||||
docker compose exec -T postgres psql -q -v ON_ERROR_STOP=1 -U "$DB_USER" -d "$DB_NAME" < backend/postgres-init/init.sql
|
||||
# 지금 빌드 파일을 모아 새 이미지에 같이 넣는다. 배포로 지우면 열어 둔 탭과 구글 렌더가 예전 HTML 로 없는 파일을 불러 첫 화면에서 멈춘다 (2주 지난 건 지움)
|
||||
mkdir -p frontend/.old-assets
|
||||
if [ -n "$(docker compose ps -q frontend)" ]; then
|
||||
docker compose cp frontend:/usr/share/nginx/html/assets/. frontend/.old-assets/
|
||||
fi
|
||||
find frontend/.old-assets -type f ! -name .gitkeep -mtime +14 -delete
|
||||
docker compose up -d --build backend worker frontend
|
||||
docker compose exec -T backend python scripts/load_seed.py
|
||||
# 피드 캐시는 최대 1시간이라, 각 규칙이 바뀌어도 오늘 탭만 옛 순위로 남는다
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
# 2026-10-14 작업 정리: 지역 검색 페이지 · 첫 접속 각 비어 보임
|
||||
|
||||
운영 반영: `ba94a38` (https://weather.o2o.kr)
|
||||
|
||||
## 1. 처음 들어온 지역에 "오늘 계산된 각이 없어요"가 뜸
|
||||
|
||||
- **문제**: 아무도 안 본 지역을 처음 열면 각이 비어 보였다. 1분쯤 지나야 채워졌다.
|
||||
- **원인**
|
||||
- 각은 그 지역에 처음 접속한 사람이 생길 때 계산한다.
|
||||
- 예보를 받아 오는 동안 다른 요청은 3초만 기다렸다. 3초 안에 못 받으면 빈 피드를 만들었다.
|
||||
- 그 빈 피드를 1분 동안 캐시에 저장해서, 그사이 들어온 사람도 계속 빈 화면을 봤다.
|
||||
- **해결** (`fix/first-region-feed`)
|
||||
- 기다리는 시간을 최대 15초로 늘렸다 (`backend/services/weather_service.py`).
|
||||
- 각이 없는 피드는 캐시에 저장하지 않는다 (`backend/services/feed_service.py`). 다음 요청에서 바로 채워진다.
|
||||
- **상태**: 운영 반영. 김해시·인제군·분당구 피드에서 각 42개가 다 나오는 것 확인.
|
||||
|
||||
## 2. 검색에 지역별 날씨 페이지가 잡히지 않음
|
||||
|
||||
- **문제**: 다른 날씨 사이트처럼 "성남시 날씨" 같은 검색에 우리 페이지가 따로 뜨지 않았다.
|
||||
- **원인**
|
||||
- 사이트가 SPA 한 장이라, 검색엔진에는 모든 주소가 같은 제목과 같은 본문으로 보였다.
|
||||
- 지역별 주소도 없었다.
|
||||
- **해결** (`feat/region-seo-pages`)
|
||||
- 빌드할 때 지역 페이지 HTML 230장을 만든다 (`frontend/vite.config.ts`).
|
||||
- `sitemap.xml`도 빌드가 자동으로 만든다. 주소는 235개다.
|
||||
- 주소: `/today/{시도}/{시군구}`. 예: `/today/gyeonggi/seongnam`, `/today/seoul/mapo`
|
||||
- **페이지 단위를 이렇게 정했다**
|
||||
- 우리 날씨 데이터는 구 단위뿐이다.
|
||||
- 구로 나뉜 13개 시는 시 페이지 하나로 묶었다: 수원·성남·고양·용인·화성·부천·안산·안양·창원·청주·포항·전주·천안. 사람들은 "성남 날씨"로 검색하지 "중원구 날씨"로는 덜 찾는다.
|
||||
- 시 페이지는 시청이 있는 구의 날씨를 보여 준다. 위치를 이미 허용했고 그 시 안에 있으면 지금 있는 구를 보여 준다.
|
||||
- 나머지(서울·광역시의 구, 군, 일반 시)는 지금 단위 그대로 페이지를 만든다.
|
||||
- 중구·동구·고성군처럼 이름이 겹치는 곳이 있어서 주소 앞에 시도를 붙였다.
|
||||
- **앱 동작** (`frontend/src/b/region.tsx`)
|
||||
- 지역 주소로 들어오면 그 지역을 보여 준다. 위치 권한은 묻지 않고 저장된 선택도 덮어쓰지 않는다.
|
||||
- 지역 페이지에서 다른 지역을 고르면 주소도 그 지역 주소로 바뀐다.
|
||||
- `/`로 들어오면 예전 그대로다.
|
||||
- **지역 목록이 바뀌면**: `python backend/scripts/gen_region_pages.py`를 실행해 `frontend/seo/region.json`을 다시 만든다.
|
||||
- **매일 돌릴 스케줄은 필요 없다**: 주소와 소개 글은 그대로이고, 그날 값은 요청이 올 때 채운다.
|
||||
|
||||
## 3. 검색 결과에 실제 날씨가 안 보임
|
||||
|
||||
- **문제**
|
||||
- AccuWeather·weather.com은 검색 결과 요약에 기온·습도 같은 실제 값이 보인다.
|
||||
- 우리 정적 페이지에는 고정 소개 글만 있었다.
|
||||
- **원인**: 정적 HTML에는 그날 값이 들어갈 수 없다.
|
||||
- **해결 (가벼운 SSR)**
|
||||
- nginx가 `/today/...` 요청을 백엔드로 넘긴다 (`frontend/nginx.conf`).
|
||||
- 백엔드는 정적 HTML을 받아 와서 설명 메타와 본문에 오늘 값을 채운다 (`backend/services/seo_service.py`, `/v1/seo/today/{sido}/{place}`). React 화면은 지금처럼 브라우저에서 그린다.
|
||||
- 피드 캐시를 그대로 써서 추가 계산은 없다.
|
||||
- 백엔드가 응답하지 않거나 오류가 나면 정적 HTML을 그대로 보여 준다.
|
||||
- **검색어에 맞춘 제목과 요약**
|
||||
```
|
||||
성남시 오늘 날씨, 뭐 할까? · 경기 | 날씨각
|
||||
최저 9°·최고 19°, 강수확률 0%, 맑음. 지금 15°, 습도 보통·자외선 낮음·미세먼지 좋음. 아침은 드라이브각, 낮은 빨래각, 저녁은 자전거각, 밤은 러닝각. 해 지는 시각 오후 5시 57분.
|
||||
```
|
||||
- **상태**: 운영 반영. 백엔드를 끈 상태에서 정적 HTML로 돌아가는 것도 로컬에서 확인했다.
|
||||
|
||||
## 4. "날씨각" 검색 결과 요약에 게시물 글이 나옴
|
||||
|
||||
- **문제**: "날씨각"으로 검색하면 요약에 "날씨각포근한 빗속, 우산 돌리며…"처럼 게시물 문장이 나왔다.
|
||||
- **원인**
|
||||
- 구글은 JS로 그려진 화면도 읽는다.
|
||||
- 게시물마다 작성자 이름 "날씨각" 바로 뒤에 그날 문장이 붙어 있다. 그래서 검색어 "날씨각"과 맞는 그 부분을 요약으로 뽑았다.
|
||||
- **해결**
|
||||
- 처음에는 게시물 카드에만 `data-nosnippet`을 달았다.
|
||||
- 색인된 지역 페이지 요약에 시간대 칸("9시 : 낮음…")과 행사 장소·기간도 섞여 나왔다. 그래서 앱 영역 전체(`#root`, `#boot`)에 `data-nosnippet`을 달았다 (`frontend/index.html`, `0d6ab29`). 이제 요약은 description(지역 페이지는 서버가 채운 오늘 날씨)을 쓴다.
|
||||
- React가 뜨면 서버가 채운 `<main>` 글은 지워지기 때문에, 요약에 쓸 글은 description뿐이다.
|
||||
- 홈 설명이 "날씨각은 …"으로 시작하게 바꿨다.
|
||||
- **상태**: 운영 반영. 구글이 다시 읽어 가야 검색 결과가 바뀐다.
|
||||
|
||||
## 5. 사이트 이름이 "에이아이오투오"로 나옴
|
||||
|
||||
- **원인**: 구글이 사이트 이름을 상위 도메인 `o2o.kr`(회사)의 이름으로 잡은 것으로 보인다.
|
||||
- **해결**
|
||||
- 우리 쪽에 필요한 표시는 이미 다 있다: 구조화 데이터 `WebSite` name "날씨각", `og:site_name`, "날씨각"으로 시작하는 제목.
|
||||
- 코드로 바로 바꿀 수는 없다. 서치콘솔에서 홈을 색인 요청하고 몇 주 기다린다.
|
||||
- **상태**: 대기
|
||||
|
||||
## 해야 할 일
|
||||
|
||||
| 상태 | 할 일 | 이유 | 관련 |
|
||||
|---|---|---|---|
|
||||
| [ ] | 네이버 서치어드바이저에 sitemap 제출, 대표 페이지 몇 개 수집 요청 | 네이버는 제출하지 않으면 새 페이지를 늦게 가져간다 | https://searchadvisor.naver.com |
|
||||
| [x] | 구글 서치콘솔에 sitemap 제출 (2026-10-14) | 색인을 앞당긴다 | https://search.google.com/search-console |
|
||||
| [ ] | 구글 URL 검사로 홈과 성남 페이지 색인 요청 | 색인과 사이트 이름 반영을 앞당긴다 | https://search.google.com/search-console |
|
||||
| [ ] | 휴대폰에서 지역 페이지 확인 | 시 안에서 내 구로 바뀌는지, 지역을 바꾸면 주소가 바뀌는지 로컬에서 확인 못 했다 | `frontend/src/b/region.tsx` |
|
||||
| [ ] | 1~2주 뒤 색인된 페이지 수 확인 | 다음 개선(문구, 홈에서 지역 페이지로 가는 링크)을 정한다 | 서치콘솔 |
|
||||
| [ ] | `test_feed_assembles_hero_stories_posts_and_bands` 기대값 40 → 42 | `0aeceac`에서 각 2개를 추가하며 안 고쳐서 main에서도 실패한다 | `backend/tests/test_feed.py:64` |
|
||||
| [ ] | 없는 지역 주소가 200으로 홈을 보여 주는 것 | SPA 기본 동작이다. canonical이 홈이라 당장 문제는 없다 | `frontend/nginx.conf` |
|
||||
| [ ] | 요약의 "해 지는 시각"을 노을이 가장 붉은 시각으로 바꿀지 | 지금은 계산으로 나온 일몰 시각이다 | `backend/services/seo_service.py` |
|
||||
|
||||
## 작업 중 있었던 일
|
||||
|
||||
- main에 push할 때 그사이 `feat/meeting-1008`이 먼저 합쳐져 있었다.
|
||||
- 그 브랜치의 탭 다시 누르면 맨 위로 기능과 `BLayout.tsx`에서 충돌이 났고, 두 변경을 다 살려 해결했다.
|
||||
- 이 저장소는 Gitea라서 `gh`로 PR을 만들 수 없다. main에 바로 합쳐서 배포했다.
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
- [ ] 사이트 데이터를 지우고 접속 → 위치 권한을 묻고, 상단 지역 버튼 자리에 스켈레톤 막대
|
||||
- [ ] 위치 허용 → 가장 가까운 구로 바뀐다 / 거부 → 기본 "서울 마포구"
|
||||
- [ ] 새로고침 → 위치를 다시 묻지 않고 마지막 지역 그대로
|
||||
- [ ] 새로고침 → 권한 창 없이 마지막 지역이 바로 보인다
|
||||
- [ ] 위치로 맞춘 뒤 다른 구로 옮겨 새로고침(또는 탭으로 돌아옴) → 스켈레톤 없이 지금 있는 구로 바뀐다 (1분 안에는 다시 읽지 않음)
|
||||
- [ ] 목록에서 고른 뒤 새로고침 → 위치와 달라도 고른 지역 그대로. "지금 위치로 찾기"를 누르면 다시 위치를 따라간다
|
||||
|
||||
## 1. 공통: 상단 바·하단 탭
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
- 앱인토스 정산 계좌(대표자 명의) 입력 시 유효성 오류 → 토스에 문의
|
||||
|
||||
## 검색 노출
|
||||
- '날씨각' 외에 '오늘 날씨'·'서울 날씨'·'성동구 날씨'·'춘천 날씨' 같은 지역 날씨 검색으로 들어오게 지역별 콘텐츠 추가, 리서치·테스트하며 개선 — 담당 김성경. 지금까지 한 것: 지역·구 페이지 274개(`96cbd19`), 검색어 리서치(`docs/검색어_인기_리서치.md`, '내일 날씨'가 '오늘 날씨'보다 훨씬 많음)
|
||||
- '날씨각' 외에 '오늘 날씨'·'서울 날씨'·'성동구 날씨'·'춘천 날씨' 같은 지역 날씨 검색으로 들어오게 지역별 콘텐츠 추가, 리서치·테스트하며 개선 — 담당 김성경. 지금까지 한 것: 지역·구 페이지 274개(`96cbd19`), 검색어 리서치(`docs/검색_노출.md` 3장, '내일 날씨'가 '오늘 날씨'보다 훨씬 많음)
|
||||
|
||||
## 홍보·수익화
|
||||
- 유튜브 채널 개설, 각 설명·오늘 날씨 숏폼 매일 자동 생성·업로드 (결정) — 기존 숏폼 자동화(크리에이토메이트 템플릿) 활용, 노하우 전수(수석, 확인 필요). 담당 미정
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
오늘 날씨 1327325B - 1327509B -
|
||||
내일 날씨 1316437B - 1316619B -
|
||||
모레 날씨 1133107B - 1133284B -
|
||||
이번주 날씨 1293893B - 1294073B -
|
||||
주말 날씨 1074907B - 1075091B -
|
||||
날씨 1372096B - 1372280B -
|
||||
서울 오늘 날씨 1322004B - 1322186B -
|
||||
서울 내일 날씨 1291547B - 1291729B -
|
||||
서울 날씨 1327104B - 1327280B -
|
||||
부산 오늘 날씨 1262153B - 1262335B -
|
||||
부산 내일 날씨 1262425B - 1262607B -
|
||||
부산 날씨 1321906B - 1322090B -
|
||||
인천 오늘 날씨 1265523B - 1265707B -
|
||||
인천 내일 날씨 1244087B - 1244271B -
|
||||
인천 날씨 1336341B - 1336525B -
|
||||
대구 오늘 날씨 1230905B - 1231085B -
|
||||
대구 내일 날씨 1239101B - 1239324B -
|
||||
대구 날씨 1310750B - 1310930B -
|
||||
대전 오늘 날씨 1245027B - 1245209B -
|
||||
대전 내일 날씨 1283918B - 1284102B -
|
||||
대전 날씨 1364500B - 1364676B -
|
||||
광주 오늘 날씨 1269511B - 1269691B -
|
||||
광주 내일 날씨 1234442B - 1234624B -
|
||||
광주 날씨 1345952B - 1346132B -
|
||||
울산 오늘 날씨 1243623B - 1243801B -
|
||||
울산 내일 날씨 1258011B - 1258193B -
|
||||
울산 날씨 1359975B - 1360155B -
|
||||
세종 오늘 날씨 1247862B - 1248044B -
|
||||
세종 내일 날씨 1285863B - 1286041B -
|
||||
세종 날씨 1266094B - 1266278B -
|
||||
수원 오늘 날씨 1280092B 14 https://weather.o2o.kr/today/gyeonggi/suwon 1280276B 14 https://weather.o2o.kr/today/gyeonggi/suwon
|
||||
수원 내일 날씨 1234640B - 1234818B -
|
||||
수원 날씨 1337906B - 1338085B -
|
||||
성남 오늘 날씨 1259351B 10 https://weather.o2o.kr/today/gyeonggi/seongnam 1259533B 10 https://weather.o2o.kr/today/gyeonggi/seongnam
|
||||
성남 내일 날씨 1234218B - 1234400B -
|
||||
성남 날씨 1202433B - 1202619B -
|
||||
고양 오늘 날씨 1282461B - 1282647B -
|
||||
고양 내일 날씨 1263819B - 1264003B -
|
||||
고양 날씨 1293534B - 1293709B -
|
||||
용인 오늘 날씨 1253712B - 1253891B -
|
||||
용인 내일 날씨 1204988B - 1205174B -
|
||||
용인 날씨 1272275B - 1272461B -
|
||||
창원 오늘 날씨 1235756B - 1235932B -
|
||||
창원 내일 날씨 1209490B - 1209674B -
|
||||
창원 날씨 1318350B - 1318537B -
|
||||
청주 오늘 날씨 1259602B - 1259793B -
|
||||
청주 내일 날씨 1271256B - 1271438B -
|
||||
청주 날씨 1357641B - 1357829B -
|
||||
천안 오늘 날씨 1208677B - 1208861B -
|
||||
천안 내일 날씨 1215383B - 1215563B -
|
||||
천안 날씨 1351073B - 1351256B -
|
||||
전주 오늘 날씨 1811260B - 1811445B -
|
||||
전주 내일 날씨 1777147B - 1777329B -
|
||||
전주 날씨 1365817B - 1365999B -
|
||||
군산 오늘 날씨 1216790B - 1216968B -
|
||||
군산 내일 날씨 1241356B - 1241538B -
|
||||
군산 날씨 1246197B - 1246376B -
|
||||
포항 오늘 날씨 1195789B - 1195972B -
|
||||
포항 내일 날씨 1243643B - 1243827B -
|
||||
포항 날씨 1360190B - 1360368B -
|
||||
제주 오늘 날씨 1293397B - 1293579B -
|
||||
제주 내일 날씨 1230790B - 1230972B -
|
||||
제주 날씨 1435113B - 1435413B -
|
||||
김해 오늘 날씨 1156065B - 1156247B -
|
||||
김해 내일 날씨 1223132B - 1223318B -
|
||||
김해 날씨 1252311B - 1252491B -
|
||||
화성 오늘 날씨 1328386B - 1328566B -
|
||||
화성 내일 날씨 1156429B - 1156611B -
|
||||
화성 날씨 1237848B - 1238030B -
|
||||
부천 오늘 날씨 1247137B - 1247321B -
|
||||
부천 내일 날씨 1262515B - 1262697B -
|
||||
부천 날씨 1091829B - 1092017B -
|
||||
안산 오늘 날씨 1222991B - 1223171B -
|
||||
안산 내일 날씨 1572193B - 1572373B -
|
||||
안산 날씨 958457B - 958639B -
|
||||
남양주 오늘 날씨 1296051B - 1296233B -
|
||||
남양주 내일 날씨 1206311B - 1206501B -
|
||||
남양주 날씨 1293872B - 1294052B -
|
||||
날씨각 628027B 1 https://weather.o2o.kr/ 628209B 1 https://weather.o2o.kr/
|
||||
|
@@ -0,0 +1,79 @@
|
||||
오늘 날씨 1371808B - 1371988B -
|
||||
내일 날씨 1286270B - 1286446B -
|
||||
모레 날씨 1150349B - 1150529B -
|
||||
이번주 날씨 1312186B - 1312373B -
|
||||
주말 날씨 1310861B - 1311044B -
|
||||
날씨 1396630B - 1396810B -
|
||||
서울 오늘 날씨 1281266B - 1281444B -
|
||||
서울 내일 날씨 1283717B - 1283899B -
|
||||
서울 날씨 1049772B - 1049958B -
|
||||
부산 오늘 날씨 1245056B - 1245233B -
|
||||
부산 내일 날씨 1266693B - 1266868B -
|
||||
부산 날씨 1301723B - 1301909B -
|
||||
인천 오늘 날씨 1269661B - 1269847B -
|
||||
인천 내일 날씨 1262166B - 1262354B -
|
||||
인천 날씨 1349694B - 1349880B -
|
||||
대구 오늘 날씨 1226277B - 1226460B -
|
||||
대구 내일 날씨 1242598B - 1242785B -
|
||||
대구 날씨 1308738B - 1308920B -
|
||||
대전 오늘 날씨 1237245B - 1237429B -
|
||||
대전 내일 날씨 1274773B - 1274955B -
|
||||
대전 날씨 1336096B - 1336282B -
|
||||
광주 오늘 날씨 1309522B - 1309708B -
|
||||
광주 내일 날씨 1252771B - 1252951B -
|
||||
광주 날씨 1327984B - 1328170B -
|
||||
울산 오늘 날씨 1262830B - 1263012B -
|
||||
울산 내일 날씨 1231480B - 1231662B -
|
||||
울산 날씨 1371449B - 1371627B -
|
||||
세종 오늘 날씨 1245527B - 1245713B -
|
||||
세종 내일 날씨 1313319B - 1313496B -
|
||||
세종 날씨 1248849B - 1249029B -
|
||||
수원 오늘 날씨 1265808B - 1265986B -
|
||||
수원 내일 날씨 1243239B - 1243419B -
|
||||
수원 날씨 1325589B - 1325769B -
|
||||
성남 오늘 날씨 1253371B - 1253553B -
|
||||
성남 내일 날씨 1177900B - 1178081B -
|
||||
성남 날씨 1214952B - 1215137B -
|
||||
고양 오늘 날씨 1270339B - 1270523B -
|
||||
고양 내일 날씨 1249671B - 1249855B -
|
||||
고양 날씨 1209803B - 1209983B -
|
||||
용인 오늘 날씨 1243446B - 1243628B -
|
||||
용인 내일 날씨 1203581B - 1203759B -
|
||||
용인 날씨 1280794B - 1280976B -
|
||||
창원 오늘 날씨 1209334B - 1209516B -
|
||||
창원 내일 날씨 1221943B - 1222123B -
|
||||
창원 날씨 1301874B - 1302054B -
|
||||
청주 오늘 날씨 1239951B - 1240137B -
|
||||
청주 내일 날씨 1253815B - 1253993B -
|
||||
청주 날씨 1340520B - 1340700B -
|
||||
천안 오늘 날씨 1221359B - 1221541B -
|
||||
천안 내일 날씨 1218803B - 1218985B -
|
||||
천안 날씨 1344315B - 1344497B -
|
||||
전주 오늘 날씨 1806743B - 1806927B -
|
||||
전주 내일 날씨 1758758B - 1758942B -
|
||||
전주 날씨 1290043B - 1290227B -
|
||||
군산 오늘 날씨 1255867B - 1256049B -
|
||||
군산 내일 날씨 1205287B - 1205467B -
|
||||
군산 날씨 1237974B - 1238154B -
|
||||
포항 오늘 날씨 1205314B - 1205500B -
|
||||
포항 내일 날씨 1256673B - 1256859B -
|
||||
포항 날씨 1338947B - 1339126B -
|
||||
제주 오늘 날씨 1284726B - 1284909B -
|
||||
제주 내일 날씨 1224271B - 1224455B -
|
||||
제주 날씨 1410935B - 1411375B -
|
||||
김해 오늘 날씨 1202848B - 1203030B -
|
||||
김해 내일 날씨 1237655B - 1237839B -
|
||||
김해 날씨 1255061B - 1255242B -
|
||||
화성 오늘 날씨 1320876B - 1321063B -
|
||||
화성 내일 날씨 1158506B - 1158690B -
|
||||
화성 날씨 1292521B - 1292705B -
|
||||
부천 오늘 날씨 1208702B - 1208884B -
|
||||
부천 내일 날씨 1207789B - 1207969B -
|
||||
부천 날씨 1057895B - 1058083B -
|
||||
안산 오늘 날씨 1257275B - 1257455B -
|
||||
안산 내일 날씨 1517067B - 1517249B -
|
||||
안산 날씨 1248040B - 1248222B -
|
||||
남양주 오늘 날씨 1314986B - 1315174B -
|
||||
남양주 내일 날씨 1246129B - 1246313B -
|
||||
남양주 날씨 1309900B - 1310086B -
|
||||
날씨각 587456B 1 https://weather.o2o.kr/ 587644B 1 https://weather.o2o.kr/
|
||||
|
@@ -0,0 +1,79 @@
|
||||
오늘 날씨 1241842B - 1242089B -
|
||||
내일 날씨 1255827B - 1241265B -
|
||||
모레 날씨 1146464B - 1150726B -
|
||||
이번주 날씨 1290799B - 1290981B -
|
||||
주말 날씨 1306886B - 1307070B -
|
||||
날씨 1404122B - 1404306B -
|
||||
서울 오늘 날씨 1241948B - 1242134B -
|
||||
서울 내일 날씨 1282168B - 1282348B -
|
||||
서울 날씨 985505B - 985689B -
|
||||
부산 오늘 날씨 1264133B - 1264313B -
|
||||
부산 내일 날씨 1265164B - 1265344B -
|
||||
부산 날씨 1213605B - 1213787B -
|
||||
인천 오늘 날씨 1300790B - 1300974B -
|
||||
인천 내일 날씨 1293527B - 1293711B -
|
||||
인천 날씨 1260461B - 1260641B -
|
||||
대구 오늘 날씨 1244846B - 1245026B -
|
||||
대구 내일 날씨 1305698B - 1305880B -
|
||||
대구 날씨 1231166B - 1231339B -
|
||||
대전 오늘 날씨 1260892B - 1261079B -
|
||||
대전 내일 날씨 1315087B - 1315271B -
|
||||
대전 날씨 1317624B - 1317802B -
|
||||
광주 오늘 날씨 1277429B - 1277605B -
|
||||
광주 내일 날씨 1282066B - 1282246B -
|
||||
광주 날씨 1265430B - 1265611B -
|
||||
울산 오늘 날씨 1238077B - 1238262B -
|
||||
울산 내일 날씨 1213012B - 1213192B -
|
||||
울산 날씨 1257139B - 1257323B -
|
||||
세종 오늘 날씨 1335637B - 1335817B -
|
||||
세종 내일 날씨 1244726B - 1244912B -
|
||||
세종 날씨 1350300B - 1350480B -
|
||||
수원 오늘 날씨 1238160B - 1238344B -
|
||||
수원 내일 날씨 1228071B - 1228249B -
|
||||
수원 날씨 1348504B - 1348684B -
|
||||
성남 오늘 날씨 1279860B - 1280042B -
|
||||
성남 내일 날씨 1189405B - 1189593B -
|
||||
성남 날씨 1239403B - 1239585B -
|
||||
고양 오늘 날씨 1286139B - 1286317B -
|
||||
고양 내일 날씨 1208419B - 1208605B -
|
||||
고양 날씨 1277571B - 1277753B -
|
||||
용인 오늘 날씨 1200469B - 1200659B -
|
||||
용인 내일 날씨 1236616B - 1236798B -
|
||||
용인 날씨 1368350B - 1368532B -
|
||||
창원 오늘 날씨 1244725B - 1244903B -
|
||||
창원 내일 날씨 1203664B - 1203844B -
|
||||
창원 날씨 1280151B - 1280329B -
|
||||
청주 오늘 날씨 1302209B - 1302391B -
|
||||
청주 내일 날씨 1278427B - 1278611B -
|
||||
청주 날씨 1368258B - 1368442B -
|
||||
천안 오늘 날씨 1236997B - 1237182B -
|
||||
천안 내일 날씨 1243104B - 1243289B -
|
||||
천안 날씨 1319722B - 1319904B -
|
||||
전주 오늘 날씨 1800004B - 1800190B -
|
||||
전주 내일 날씨 1783583B - 1783765B -
|
||||
전주 날씨 1261004B - 1261188B -
|
||||
군산 오늘 날씨 1282946B - 1283130B -
|
||||
군산 내일 날씨 1271879B - 1272061B -
|
||||
군산 날씨 1267946B - 1268128B -
|
||||
포항 오늘 날씨 1279182B - 1279362B -
|
||||
포항 내일 날씨 1261670B - 1261854B -
|
||||
포항 날씨 1308817B - 1309003B -
|
||||
제주 오늘 날씨 1253715B - 1253895B -
|
||||
제주 내일 날씨 1334766B - 1334942B -
|
||||
제주 날씨 1308240B - 1308434B -
|
||||
김해 오늘 날씨 1221203B - 1221389B -
|
||||
김해 내일 날씨 1221664B - 1221844B -
|
||||
김해 날씨 1287333B - 1287517B -
|
||||
화성 오늘 날씨 1249282B - 1249468B -
|
||||
화성 내일 날씨 1233491B - 1233673B -
|
||||
화성 날씨 997204B - 997384B -
|
||||
부천 오늘 날씨 924121B - 924303B -
|
||||
부천 내일 날씨 1239101B - 1239281B -
|
||||
부천 날씨 1060555B - 1060741B -
|
||||
안산 오늘 날씨 1271510B - 1271690B -
|
||||
안산 내일 날씨 1590933B - 1591114B -
|
||||
안산 날씨 1273204B - 1273392B -
|
||||
남양주 오늘 날씨 1240661B - 1240841B -
|
||||
남양주 내일 날씨 1263026B - 1263214B -
|
||||
남양주 날씨 1308914B - 1309096B -
|
||||
날씨각 612597B 1 https://weather.o2o.kr/tomorrow/incheon/namdong 612783B 1 https://weather.o2o.kr/tomorrow/incheon/namdong
|
||||
|
@@ -0,0 +1,20 @@
|
||||
날씨각 600502 1 https://weather.o2o.kr/ https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU weather.o2o.kr ko.meteocast.in jongno.webforai.kr gunsan.webforai.kr danyang.webforai.kr gangneung.webforai.kr daegu.webforai.kr gall.dcinside.com chuncheon.webforai.kr busan.webforai.kr haenam.webforai.kr jeju.webforai.kr yeosu.webforai.kr
|
||||
오늘 날씨 1113195 - weather.go.kr weatheri.co.kr kma.go.kr accuweather.com ytn.co.kr yonhapnewstv.co.kr weeklytoday.com kweather.co.kr
|
||||
분당구 오늘 날씨 969363 12 https://weather.o2o.kr/ https://weather.o2o.kr/tomorrow/gyeonggi/seongnam/bundang weather.go.kr weatheri.co.kr weather.com accuweather.com kr-weathernews.com here-weather.hongry.dev ryanpp.com skyforecaster.com weawow.com rp5.md rp5.in weather.o2o.kr rp5.kz
|
||||
분당 날씨 1276832 17 https://weather.o2o.kr/ https://weather.o2o.kr/tomorrow/gyeonggi/seongnam/bundang weather.go.kr weatheri.co.kr accuweather.com bundang-gu.go.kr:10009 weather.com yonhapnewstv.co.kr magazine.hankyung.com doctorstimes.com msn.com kr-weathernews.com ryanpp.com skyforecaster.com here-weather.hongry.dev rp5.kz rp5.in
|
||||
성남 오늘 날씨 1218291 - weather.go.kr weatheri.co.kr weather.com accuweather.com ko.meteotrend.com kr-weathernews.com here-weather.hongry.dev wikitree.co.kr thefairnews.co.kr jasm.co.kr ko.meteocast.in korea247.kr weatherootd.com temperatureoutfit.com skyforecaster.com
|
||||
마포구 오늘 날씨 1297676 - weather.go.kr weatheri.co.kr weather.com accuweather.com kr-weathernews.com ko.meteotrend.com here-weather.hongry.dev ko.meteocast.net skyforecaster.com rp5.am rp5.in
|
||||
마포구 날씨 1328417 - weather.go.kr weatheri.co.kr accuweather.com weather.com ko.weather-forecasts.ru rp5.ru ko.meteotrend.com ko.meteocast.net here-weather.hongry.dev kr-weathernews.com triptokr.com ko.climate-data.org skyforecaster.com rp5.am youtube.com
|
||||
강남구 오늘 날씨 1218698 - weather.go.kr weatheri.co.kr weather.com accuweather.com weather.guidejung.com ko.meteotrend.com here-weather.hongry.dev kr-weathernews.com roach.kr weawow.com skyforecaster.com ko.meteocast.net ko.climate-data.org rp5.am rp5.ru
|
||||
세차하기 좋은 날 1350645 - youtube.com koreacarcare.com gjdream.com commercial.platformdodam.com issuetale.kr bigmycn.com 114.co.kr ok114.co.kr xn--hq1bk10a0wb12g.kr bizno.net daangn.com
|
||||
빨래하기 좋은 날 1407753 - freecolumn.co.kr link.coupang.com animalcrossing.soopoolleaf.com daangn.com melon.com place.udanax.org cokmap.com moneypin.biz tounou.co.kr bizno.net itovic.com tokyobasket.com brunch.co.kr
|
||||
오늘 노을 시간 899512 4 https://weather.o2o.kr/ https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU weather.go.kr skytime.kr astro.kasi.re.kr weather.o2o.kr namu.wiki hangang.seoul.go.kr cleaveliving.com kr.investing.com bntnews.co.kr wikitree.co.kr hyunbulnews.com where-is-daylight.hongry.dev alpenglowapp.com cafe.ambitstock.com brunch.co.kr
|
||||
이번 주말 날씨 1296062 - weather.go.kr weatheri.co.kr youtube.com kma.go.kr ytn.co.kr newscj.com weather.daum.net
|
||||
세차각 941909 2 https://weather.o2o.kr/ https://weather.o2o.kr/gak sechagak.com weather.o2o.kr arca.live fmkorea.com clien.net gall.dcinside.com dogdrip.net godrichstory.com
|
||||
수원 오늘 날씨 1304854 - weather.go.kr weatheri.co.kr krweb.wni.com kma.go.kr u.suwon.go.kr weather.com accuweather.com pointdaily.co.kr thekpm.com economytalk.kr dailian.co.kr news.tf.co.kr econonews.co.kr kr-weathernews.com ko.meteotrend.com
|
||||
송파구 오늘 날씨 1229329 - weather.go.kr weatheri.co.kr accuweather.com weather.com kr-weathernews.com here-weather.hongry.dev msn.com rp5.ru ko.meteotrend.com weawow.com skyforecaster.com ko.meteocast.net rp5.in hosting.weatherimc.co.kr
|
||||
성동구 오늘 날씨 1279146 7 https://weather.o2o.kr/ https://weather.o2o.kr/today/seoul/seongdong https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU https://weather.o2o.kr/shorts/noizuUXFHA8 https://weather.o2o.kr/shorts/YnyzMEublvY weather.go.kr weatheri.co.kr accuweather.com weather.com weatheroutfit.com here-weather.hongry.dev weather.o2o.kr kr-weathernews.com korea247.kr skyforecaster.com weawow.com han-nun.com ko.meteocast.net ko.meteotrend.com rp5.am
|
||||
연수구 오늘 날씨 1183295 - weather.go.kr weatheri.co.kr weather.com accuweather.com krweb.wni.com here-weather.hongry.dev kr-weathernews.com rp5.am skyforecaster.com 114.ai.kr ko.meteotrend.com rp5.in ko.weather-forecasts.ru weawow.com ko.meteocast.net
|
||||
구로구 오늘 날씨 1088635 10 https://weather.o2o.kr/ https://weather.o2o.kr/today/seoul/guro https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU weather.go.kr weatheri.co.kr accuweather.com kr-weathernews.com skyforecaster.com ko.meteotrend.com here-weather.hongry.dev rp5.ru weawow.com weather.o2o.kr ko.meteocast.net korea247.kr jusoen.com
|
||||
부평구 오늘 날씨 980672 - weather.go.kr weatheri.co.kr accuweather.com weather.com here-weather.hongry.dev kr-weathernews.com ko.meteotrend.com ryanpp.com weathernews.com newsinside.kr skyforecaster.com weawow.com hosting.weatherimc.co.kr ko.meteocast.net rp5.in
|
||||
site:weather.o2o.kr 567809 1 https://weather.o2o.kr/ https://weather.o2o.kr/shorts/T3xU5GetD5M https://weather.o2o.kr/shorts/JiYcNjdntUQ https://weather.o2o.kr/shorts/bc1jagramP0 https://weather.o2o.kr/shorts/LKHGGv2n6bA https://weather.o2o.kr/shorts/Yas5G_lXkPE https://weather.o2o.kr/shorts/zPMUrA2Lg6I https://weather.o2o.kr/shorts/zqfa0EK_Eak https://weather.o2o.kr/shorts/QhL0NNDiJZU https://weather.o2o.kr/gak https://weather.o2o.kr/faq https://weather.o2o.kr/sky https://weather.o2o.kr/saju https://weather.o2o.kr/game https://weather.o2o.kr/week https://weather.o2o.kr/faq/busan https://weather.o2o.kr/today/jeonbuk/gunsan https://weather.o2o.kr/today/busan/haeundae https://weather.o2o.kr/faq/sejong https://weather.o2o.kr/faq/jeonbuk https://weather.o2o.kr/faq/gyeonggi https://weather.o2o.kr/faq/chungnam https://weather.o2o.kr/faq/chungbuk https://weather.o2o.kr/faq/gyeongnam https://weather.o2o.kr/today/busan/seo https://weather.o2o.kr/shorts/ZT0p0cM0zrA https://weather.o2o.kr/today/ulsan/nam https://weather.o2o.kr/shorts/noizuUXFHA8 https://weather.o2o.kr/shorts/YnyzMEublvY https://weather.o2o.kr/today/daegu/seo https://weather.o2o.kr/today/seoul/mapo weather.o2o.kr
|
||||
|
@@ -0,0 +1,536 @@
|
||||
# 네이버 색인 안 된 것으로 보는 주소 (2026-10-28). 기준: docs/검색_노출.md 5장(노출 기록)의 네이버 색인 확인(홈·성남·수원·부평·연수·강남·구로·마포·성동·송파·종로·중구·용산·/sky·/week·/season)에서 빠진 것. 구글은 10/21·10/23 서치 콘솔 URL 검사에서 확인한 구 39개·내일 13곳이 모두 등록돼 있어 제외.
|
||||
|
||||
# 1) 구 주소 39개 — 39개
|
||||
https://weather.o2o.kr/today/gyeonggi/suwon/jangan
|
||||
https://weather.o2o.kr/today/gyeonggi/suwon/gwonseon
|
||||
https://weather.o2o.kr/today/gyeonggi/suwon/paldal
|
||||
https://weather.o2o.kr/today/gyeonggi/suwon/yeongtong
|
||||
https://weather.o2o.kr/today/gyeonggi/seongnam/sujeong
|
||||
https://weather.o2o.kr/today/gyeonggi/seongnam/jungwon
|
||||
https://weather.o2o.kr/today/gyeonggi/seongnam/bundang
|
||||
https://weather.o2o.kr/today/gyeonggi/anyang/manan
|
||||
https://weather.o2o.kr/today/gyeonggi/anyang/dongan
|
||||
https://weather.o2o.kr/today/gyeonggi/bucheon/wonmi
|
||||
https://weather.o2o.kr/today/gyeonggi/bucheon/sosa
|
||||
https://weather.o2o.kr/today/gyeonggi/bucheon/ojeong
|
||||
https://weather.o2o.kr/today/gyeonggi/ansan/sangnok
|
||||
https://weather.o2o.kr/today/gyeonggi/ansan/danwon
|
||||
https://weather.o2o.kr/today/gyeonggi/goyang/deogyang
|
||||
https://weather.o2o.kr/today/gyeonggi/goyang/ilsandong
|
||||
https://weather.o2o.kr/today/gyeonggi/goyang/ilsanseo
|
||||
https://weather.o2o.kr/today/gyeonggi/yongin/cheoin
|
||||
https://weather.o2o.kr/today/gyeonggi/yongin/giheung
|
||||
https://weather.o2o.kr/today/gyeonggi/yongin/suji
|
||||
https://weather.o2o.kr/today/gyeonggi/hwaseong/manse
|
||||
https://weather.o2o.kr/today/gyeonggi/hwaseong/hyohaeng
|
||||
https://weather.o2o.kr/today/gyeonggi/hwaseong/byeongjeom
|
||||
https://weather.o2o.kr/today/gyeonggi/hwaseong/dongtan
|
||||
https://weather.o2o.kr/today/chungbuk/cheongju/sangdang
|
||||
https://weather.o2o.kr/today/chungbuk/cheongju/seowon
|
||||
https://weather.o2o.kr/today/chungbuk/cheongju/heungdeok
|
||||
https://weather.o2o.kr/today/chungbuk/cheongju/cheongwon
|
||||
https://weather.o2o.kr/today/chungnam/cheonan/dongnam
|
||||
https://weather.o2o.kr/today/chungnam/cheonan/seobuk
|
||||
https://weather.o2o.kr/today/gyeongbuk/pohang/nam
|
||||
https://weather.o2o.kr/today/gyeongbuk/pohang/buk
|
||||
https://weather.o2o.kr/today/gyeongnam/changwon/uichang
|
||||
https://weather.o2o.kr/today/gyeongnam/changwon/seongsan
|
||||
https://weather.o2o.kr/today/gyeongnam/changwon/masanhappo
|
||||
https://weather.o2o.kr/today/gyeongnam/changwon/masanhoewon
|
||||
https://weather.o2o.kr/today/gyeongnam/changwon/jinhae
|
||||
https://weather.o2o.kr/today/jeonbuk/jeonju/wansan
|
||||
https://weather.o2o.kr/today/jeonbuk/jeonju/deokjin
|
||||
|
||||
# 2) 시·군·구 지역 페이지 (네이버 미색인) — 218개
|
||||
https://weather.o2o.kr/today/seoul/gwangjin
|
||||
https://weather.o2o.kr/today/seoul/dongdaemun
|
||||
https://weather.o2o.kr/today/seoul/jungnang
|
||||
https://weather.o2o.kr/today/seoul/seongbuk
|
||||
https://weather.o2o.kr/today/seoul/gangbuk
|
||||
https://weather.o2o.kr/today/seoul/dobong
|
||||
https://weather.o2o.kr/today/seoul/nowon
|
||||
https://weather.o2o.kr/today/seoul/eunpyeong
|
||||
https://weather.o2o.kr/today/seoul/seodaemun
|
||||
https://weather.o2o.kr/today/seoul/yangcheon
|
||||
https://weather.o2o.kr/today/seoul/gangseo
|
||||
https://weather.o2o.kr/today/seoul/geumcheon
|
||||
https://weather.o2o.kr/today/seoul/yeongdeungpo
|
||||
https://weather.o2o.kr/today/seoul/dongjak
|
||||
https://weather.o2o.kr/today/seoul/gwanak
|
||||
https://weather.o2o.kr/today/seoul/seocho
|
||||
https://weather.o2o.kr/today/seoul/gangdong
|
||||
https://weather.o2o.kr/today/jeonnam/mokpo
|
||||
https://weather.o2o.kr/today/jeonnam/yeosu
|
||||
https://weather.o2o.kr/today/jeonnam/suncheon
|
||||
https://weather.o2o.kr/today/jeonnam/naju
|
||||
https://weather.o2o.kr/today/jeonnam/gwangyang
|
||||
https://weather.o2o.kr/today/gwangju/dong
|
||||
https://weather.o2o.kr/today/gwangju/seo
|
||||
https://weather.o2o.kr/today/gwangju/nam
|
||||
https://weather.o2o.kr/today/gwangju/buk
|
||||
https://weather.o2o.kr/today/gwangju/gwangsan
|
||||
https://weather.o2o.kr/today/jeonnam/damyang
|
||||
https://weather.o2o.kr/today/jeonnam/gokseong
|
||||
https://weather.o2o.kr/today/jeonnam/gurye
|
||||
https://weather.o2o.kr/today/jeonnam/goheung
|
||||
https://weather.o2o.kr/today/jeonnam/boseong
|
||||
https://weather.o2o.kr/today/jeonnam/hwasun
|
||||
https://weather.o2o.kr/today/jeonnam/jangheung
|
||||
https://weather.o2o.kr/today/jeonnam/gangjin
|
||||
https://weather.o2o.kr/today/jeonnam/haenam
|
||||
https://weather.o2o.kr/today/jeonnam/yeongam
|
||||
https://weather.o2o.kr/today/jeonnam/muan
|
||||
https://weather.o2o.kr/today/jeonnam/hampyeong
|
||||
https://weather.o2o.kr/today/jeonnam/yeonggwang
|
||||
https://weather.o2o.kr/today/jeonnam/jangseong
|
||||
https://weather.o2o.kr/today/jeonnam/wando
|
||||
https://weather.o2o.kr/today/jeonnam/jindo
|
||||
https://weather.o2o.kr/today/jeonnam/sinan
|
||||
https://weather.o2o.kr/today/busan/jung
|
||||
https://weather.o2o.kr/today/busan/seo
|
||||
https://weather.o2o.kr/today/busan/dong
|
||||
https://weather.o2o.kr/today/busan/yeongdo
|
||||
https://weather.o2o.kr/today/busan/busanjin
|
||||
https://weather.o2o.kr/today/busan/dongnae
|
||||
https://weather.o2o.kr/today/busan/nam
|
||||
https://weather.o2o.kr/today/busan/buk
|
||||
https://weather.o2o.kr/today/busan/haeundae
|
||||
https://weather.o2o.kr/today/busan/saha
|
||||
https://weather.o2o.kr/today/busan/geumjeong
|
||||
https://weather.o2o.kr/today/busan/gangseo
|
||||
https://weather.o2o.kr/today/busan/yeonje
|
||||
https://weather.o2o.kr/today/busan/suyeong
|
||||
https://weather.o2o.kr/today/busan/sasang
|
||||
https://weather.o2o.kr/today/busan/gijang
|
||||
https://weather.o2o.kr/today/daegu/jung
|
||||
https://weather.o2o.kr/today/daegu/dong
|
||||
https://weather.o2o.kr/today/daegu/seo
|
||||
https://weather.o2o.kr/today/daegu/nam
|
||||
https://weather.o2o.kr/today/daegu/buk
|
||||
https://weather.o2o.kr/today/daegu/suseong
|
||||
https://weather.o2o.kr/today/daegu/dalseo
|
||||
https://weather.o2o.kr/today/daegu/dalseong
|
||||
https://weather.o2o.kr/today/daegu/gunwi
|
||||
https://weather.o2o.kr/today/incheon/jemulpo
|
||||
https://weather.o2o.kr/today/incheon/yeongjong
|
||||
https://weather.o2o.kr/today/incheon/michuhol
|
||||
https://weather.o2o.kr/today/incheon/namdong
|
||||
https://weather.o2o.kr/today/incheon/gyeyang
|
||||
https://weather.o2o.kr/today/incheon/seohae
|
||||
https://weather.o2o.kr/today/incheon/geomdan
|
||||
https://weather.o2o.kr/today/incheon/ganghwa
|
||||
https://weather.o2o.kr/today/incheon/ongjin
|
||||
https://weather.o2o.kr/today/daejeon/dong
|
||||
https://weather.o2o.kr/today/daejeon/jung
|
||||
https://weather.o2o.kr/today/daejeon/seo
|
||||
https://weather.o2o.kr/today/daejeon/yuseong
|
||||
https://weather.o2o.kr/today/daejeon/daedeok
|
||||
https://weather.o2o.kr/today/ulsan/jung
|
||||
https://weather.o2o.kr/today/ulsan/nam
|
||||
https://weather.o2o.kr/today/ulsan/dong
|
||||
https://weather.o2o.kr/today/ulsan/buk
|
||||
https://weather.o2o.kr/today/ulsan/ulju
|
||||
https://weather.o2o.kr/today/sejong/sejong
|
||||
https://weather.o2o.kr/today/gyeonggi/uijeongbu
|
||||
https://weather.o2o.kr/today/gyeonggi/anyang
|
||||
https://weather.o2o.kr/today/gyeonggi/bucheon
|
||||
https://weather.o2o.kr/today/gyeonggi/gwangmyeong
|
||||
https://weather.o2o.kr/today/gyeonggi/pyeongtaek
|
||||
https://weather.o2o.kr/today/gyeonggi/dongducheon
|
||||
https://weather.o2o.kr/today/gyeonggi/ansan
|
||||
https://weather.o2o.kr/today/gyeonggi/goyang
|
||||
https://weather.o2o.kr/today/gyeonggi/gwacheon
|
||||
https://weather.o2o.kr/today/gyeonggi/guri
|
||||
https://weather.o2o.kr/today/gyeonggi/namyangju
|
||||
https://weather.o2o.kr/today/gyeonggi/osan
|
||||
https://weather.o2o.kr/today/gyeonggi/siheung
|
||||
https://weather.o2o.kr/today/gyeonggi/gunpo
|
||||
https://weather.o2o.kr/today/gyeonggi/uiwang
|
||||
https://weather.o2o.kr/today/gyeonggi/hanam
|
||||
https://weather.o2o.kr/today/gyeonggi/yongin
|
||||
https://weather.o2o.kr/today/gyeonggi/paju
|
||||
https://weather.o2o.kr/today/gyeonggi/icheon
|
||||
https://weather.o2o.kr/today/gyeonggi/anseong
|
||||
https://weather.o2o.kr/today/gyeonggi/gimpo
|
||||
https://weather.o2o.kr/today/gyeonggi/hwaseong
|
||||
https://weather.o2o.kr/today/gyeonggi/gwangju
|
||||
https://weather.o2o.kr/today/gyeonggi/yangju
|
||||
https://weather.o2o.kr/today/gyeonggi/pocheon
|
||||
https://weather.o2o.kr/today/gyeonggi/yeoju
|
||||
https://weather.o2o.kr/today/gyeonggi/yeoncheon
|
||||
https://weather.o2o.kr/today/gyeonggi/gapyeong
|
||||
https://weather.o2o.kr/today/gyeonggi/yangpyeong
|
||||
https://weather.o2o.kr/today/chungbuk/cheongju
|
||||
https://weather.o2o.kr/today/chungbuk/chungju
|
||||
https://weather.o2o.kr/today/chungbuk/jecheon
|
||||
https://weather.o2o.kr/today/chungbuk/boeun
|
||||
https://weather.o2o.kr/today/chungbuk/okcheon
|
||||
https://weather.o2o.kr/today/chungbuk/yeongdong
|
||||
https://weather.o2o.kr/today/chungbuk/jeungpyeong
|
||||
https://weather.o2o.kr/today/chungbuk/jincheon
|
||||
https://weather.o2o.kr/today/chungbuk/goesan
|
||||
https://weather.o2o.kr/today/chungbuk/eumseong
|
||||
https://weather.o2o.kr/today/chungbuk/danyang
|
||||
https://weather.o2o.kr/today/chungnam/cheonan
|
||||
https://weather.o2o.kr/today/chungnam/gongju
|
||||
https://weather.o2o.kr/today/chungnam/boryeong
|
||||
https://weather.o2o.kr/today/chungnam/asan
|
||||
https://weather.o2o.kr/today/chungnam/seosan
|
||||
https://weather.o2o.kr/today/chungnam/nonsan
|
||||
https://weather.o2o.kr/today/chungnam/gyeryong
|
||||
https://weather.o2o.kr/today/chungnam/dangjin
|
||||
https://weather.o2o.kr/today/chungnam/geumsan
|
||||
https://weather.o2o.kr/today/chungnam/buyeo
|
||||
https://weather.o2o.kr/today/chungnam/seocheon
|
||||
https://weather.o2o.kr/today/chungnam/cheongyang
|
||||
https://weather.o2o.kr/today/chungnam/hongseong
|
||||
https://weather.o2o.kr/today/chungnam/yesan
|
||||
https://weather.o2o.kr/today/chungnam/taean
|
||||
https://weather.o2o.kr/today/gyeongbuk/pohang
|
||||
https://weather.o2o.kr/today/gyeongbuk/gyeongju
|
||||
https://weather.o2o.kr/today/gyeongbuk/gimcheon
|
||||
https://weather.o2o.kr/today/gyeongbuk/andong
|
||||
https://weather.o2o.kr/today/gyeongbuk/gumi
|
||||
https://weather.o2o.kr/today/gyeongbuk/yeongju
|
||||
https://weather.o2o.kr/today/gyeongbuk/yeongcheon
|
||||
https://weather.o2o.kr/today/gyeongbuk/sangju
|
||||
https://weather.o2o.kr/today/gyeongbuk/mungyeong
|
||||
https://weather.o2o.kr/today/gyeongbuk/gyeongsan
|
||||
https://weather.o2o.kr/today/gyeongbuk/uiseong
|
||||
https://weather.o2o.kr/today/gyeongbuk/cheongsong
|
||||
https://weather.o2o.kr/today/gyeongbuk/yeongyang
|
||||
https://weather.o2o.kr/today/gyeongbuk/yeongdeok
|
||||
https://weather.o2o.kr/today/gyeongbuk/cheongdo
|
||||
https://weather.o2o.kr/today/gyeongbuk/goryeong
|
||||
https://weather.o2o.kr/today/gyeongbuk/seongju
|
||||
https://weather.o2o.kr/today/gyeongbuk/chilgok
|
||||
https://weather.o2o.kr/today/gyeongbuk/yecheon
|
||||
https://weather.o2o.kr/today/gyeongbuk/bonghwa
|
||||
https://weather.o2o.kr/today/gyeongbuk/uljin
|
||||
https://weather.o2o.kr/today/gyeongbuk/ulleung
|
||||
https://weather.o2o.kr/today/gyeongnam/changwon
|
||||
https://weather.o2o.kr/today/gyeongnam/jinju
|
||||
https://weather.o2o.kr/today/gyeongnam/tongyeong
|
||||
https://weather.o2o.kr/today/gyeongnam/sacheon
|
||||
https://weather.o2o.kr/today/gyeongnam/gimhae
|
||||
https://weather.o2o.kr/today/gyeongnam/miryang
|
||||
https://weather.o2o.kr/today/gyeongnam/geoje
|
||||
https://weather.o2o.kr/today/gyeongnam/yangsan
|
||||
https://weather.o2o.kr/today/gyeongnam/uiryeong
|
||||
https://weather.o2o.kr/today/gyeongnam/haman
|
||||
https://weather.o2o.kr/today/gyeongnam/changnyeong
|
||||
https://weather.o2o.kr/today/gyeongnam/goseong
|
||||
https://weather.o2o.kr/today/gyeongnam/namhae
|
||||
https://weather.o2o.kr/today/gyeongnam/hadong
|
||||
https://weather.o2o.kr/today/gyeongnam/sancheong
|
||||
https://weather.o2o.kr/today/gyeongnam/hamyang
|
||||
https://weather.o2o.kr/today/gyeongnam/geochang
|
||||
https://weather.o2o.kr/today/gyeongnam/hapcheon
|
||||
https://weather.o2o.kr/today/jeju/jeju
|
||||
https://weather.o2o.kr/today/jeju/seogwipo
|
||||
https://weather.o2o.kr/today/gangwon/chuncheon
|
||||
https://weather.o2o.kr/today/gangwon/wonju
|
||||
https://weather.o2o.kr/today/gangwon/gangneung
|
||||
https://weather.o2o.kr/today/gangwon/donghae
|
||||
https://weather.o2o.kr/today/gangwon/taebaek
|
||||
https://weather.o2o.kr/today/gangwon/sokcho
|
||||
https://weather.o2o.kr/today/gangwon/samcheok
|
||||
https://weather.o2o.kr/today/gangwon/hongcheon
|
||||
https://weather.o2o.kr/today/gangwon/hoengseong
|
||||
https://weather.o2o.kr/today/gangwon/yeongwol
|
||||
https://weather.o2o.kr/today/gangwon/pyeongchang
|
||||
https://weather.o2o.kr/today/gangwon/jeongseon
|
||||
https://weather.o2o.kr/today/gangwon/cheorwon
|
||||
https://weather.o2o.kr/today/gangwon/hwacheon
|
||||
https://weather.o2o.kr/today/gangwon/yanggu
|
||||
https://weather.o2o.kr/today/gangwon/inje
|
||||
https://weather.o2o.kr/today/gangwon/goseong
|
||||
https://weather.o2o.kr/today/gangwon/yangyang
|
||||
https://weather.o2o.kr/today/jeonbuk/jeonju
|
||||
https://weather.o2o.kr/today/jeonbuk/gunsan
|
||||
https://weather.o2o.kr/today/jeonbuk/iksan
|
||||
https://weather.o2o.kr/today/jeonbuk/jeongeup
|
||||
https://weather.o2o.kr/today/jeonbuk/namwon
|
||||
https://weather.o2o.kr/today/jeonbuk/gimje
|
||||
https://weather.o2o.kr/today/jeonbuk/wanju
|
||||
https://weather.o2o.kr/today/jeonbuk/jinan
|
||||
https://weather.o2o.kr/today/jeonbuk/muju
|
||||
https://weather.o2o.kr/today/jeonbuk/jangsu
|
||||
https://weather.o2o.kr/today/jeonbuk/imsil
|
||||
https://weather.o2o.kr/today/jeonbuk/sunchang
|
||||
https://weather.o2o.kr/today/jeonbuk/gochang
|
||||
https://weather.o2o.kr/today/jeonbuk/buan
|
||||
|
||||
# 3) 기타 페이지 — 1개
|
||||
https://weather.o2o.kr/gak
|
||||
|
||||
# 4) 내일 날씨 페이지 (10/23 배포) — 269개
|
||||
https://weather.o2o.kr/tomorrow/seoul/jongno
|
||||
https://weather.o2o.kr/tomorrow/seoul/jung
|
||||
https://weather.o2o.kr/tomorrow/seoul/yongsan
|
||||
https://weather.o2o.kr/tomorrow/seoul/seongdong
|
||||
https://weather.o2o.kr/tomorrow/seoul/gwangjin
|
||||
https://weather.o2o.kr/tomorrow/seoul/dongdaemun
|
||||
https://weather.o2o.kr/tomorrow/seoul/jungnang
|
||||
https://weather.o2o.kr/tomorrow/seoul/seongbuk
|
||||
https://weather.o2o.kr/tomorrow/seoul/gangbuk
|
||||
https://weather.o2o.kr/tomorrow/seoul/dobong
|
||||
https://weather.o2o.kr/tomorrow/seoul/nowon
|
||||
https://weather.o2o.kr/tomorrow/seoul/eunpyeong
|
||||
https://weather.o2o.kr/tomorrow/seoul/seodaemun
|
||||
https://weather.o2o.kr/tomorrow/seoul/mapo
|
||||
https://weather.o2o.kr/tomorrow/seoul/yangcheon
|
||||
https://weather.o2o.kr/tomorrow/seoul/gangseo
|
||||
https://weather.o2o.kr/tomorrow/seoul/guro
|
||||
https://weather.o2o.kr/tomorrow/seoul/geumcheon
|
||||
https://weather.o2o.kr/tomorrow/seoul/yeongdeungpo
|
||||
https://weather.o2o.kr/tomorrow/seoul/dongjak
|
||||
https://weather.o2o.kr/tomorrow/seoul/gwanak
|
||||
https://weather.o2o.kr/tomorrow/seoul/seocho
|
||||
https://weather.o2o.kr/tomorrow/seoul/gangnam
|
||||
https://weather.o2o.kr/tomorrow/seoul/songpa
|
||||
https://weather.o2o.kr/tomorrow/seoul/gangdong
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/mokpo
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/yeosu
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/suncheon
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/naju
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/gwangyang
|
||||
https://weather.o2o.kr/tomorrow/gwangju/dong
|
||||
https://weather.o2o.kr/tomorrow/gwangju/seo
|
||||
https://weather.o2o.kr/tomorrow/gwangju/nam
|
||||
https://weather.o2o.kr/tomorrow/gwangju/buk
|
||||
https://weather.o2o.kr/tomorrow/gwangju/gwangsan
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/damyang
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/gokseong
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/gurye
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/goheung
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/boseong
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/hwasun
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/jangheung
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/gangjin
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/haenam
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/yeongam
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/muan
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/hampyeong
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/yeonggwang
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/jangseong
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/wando
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/jindo
|
||||
https://weather.o2o.kr/tomorrow/jeonnam/sinan
|
||||
https://weather.o2o.kr/tomorrow/busan/jung
|
||||
https://weather.o2o.kr/tomorrow/busan/seo
|
||||
https://weather.o2o.kr/tomorrow/busan/dong
|
||||
https://weather.o2o.kr/tomorrow/busan/yeongdo
|
||||
https://weather.o2o.kr/tomorrow/busan/busanjin
|
||||
https://weather.o2o.kr/tomorrow/busan/dongnae
|
||||
https://weather.o2o.kr/tomorrow/busan/nam
|
||||
https://weather.o2o.kr/tomorrow/busan/buk
|
||||
https://weather.o2o.kr/tomorrow/busan/haeundae
|
||||
https://weather.o2o.kr/tomorrow/busan/saha
|
||||
https://weather.o2o.kr/tomorrow/busan/geumjeong
|
||||
https://weather.o2o.kr/tomorrow/busan/gangseo
|
||||
https://weather.o2o.kr/tomorrow/busan/yeonje
|
||||
https://weather.o2o.kr/tomorrow/busan/suyeong
|
||||
https://weather.o2o.kr/tomorrow/busan/sasang
|
||||
https://weather.o2o.kr/tomorrow/busan/gijang
|
||||
https://weather.o2o.kr/tomorrow/daegu/jung
|
||||
https://weather.o2o.kr/tomorrow/daegu/dong
|
||||
https://weather.o2o.kr/tomorrow/daegu/seo
|
||||
https://weather.o2o.kr/tomorrow/daegu/nam
|
||||
https://weather.o2o.kr/tomorrow/daegu/buk
|
||||
https://weather.o2o.kr/tomorrow/daegu/suseong
|
||||
https://weather.o2o.kr/tomorrow/daegu/dalseo
|
||||
https://weather.o2o.kr/tomorrow/daegu/dalseong
|
||||
https://weather.o2o.kr/tomorrow/daegu/gunwi
|
||||
https://weather.o2o.kr/tomorrow/incheon/jemulpo
|
||||
https://weather.o2o.kr/tomorrow/incheon/yeongjong
|
||||
https://weather.o2o.kr/tomorrow/incheon/michuhol
|
||||
https://weather.o2o.kr/tomorrow/incheon/yeonsu
|
||||
https://weather.o2o.kr/tomorrow/incheon/namdong
|
||||
https://weather.o2o.kr/tomorrow/incheon/bupyeong
|
||||
https://weather.o2o.kr/tomorrow/incheon/gyeyang
|
||||
https://weather.o2o.kr/tomorrow/incheon/seohae
|
||||
https://weather.o2o.kr/tomorrow/incheon/geomdan
|
||||
https://weather.o2o.kr/tomorrow/incheon/ganghwa
|
||||
https://weather.o2o.kr/tomorrow/incheon/ongjin
|
||||
https://weather.o2o.kr/tomorrow/daejeon/dong
|
||||
https://weather.o2o.kr/tomorrow/daejeon/jung
|
||||
https://weather.o2o.kr/tomorrow/daejeon/seo
|
||||
https://weather.o2o.kr/tomorrow/daejeon/yuseong
|
||||
https://weather.o2o.kr/tomorrow/daejeon/daedeok
|
||||
https://weather.o2o.kr/tomorrow/ulsan/jung
|
||||
https://weather.o2o.kr/tomorrow/ulsan/nam
|
||||
https://weather.o2o.kr/tomorrow/ulsan/dong
|
||||
https://weather.o2o.kr/tomorrow/ulsan/buk
|
||||
https://weather.o2o.kr/tomorrow/ulsan/ulju
|
||||
https://weather.o2o.kr/tomorrow/sejong/sejong
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/suwon
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/suwon/jangan
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/suwon/gwonseon
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/suwon/paldal
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/suwon/yeongtong
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/seongnam
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/seongnam/sujeong
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/seongnam/jungwon
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/seongnam/bundang
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/uijeongbu
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/anyang
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/anyang/manan
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/anyang/dongan
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/bucheon
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/bucheon/wonmi
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/bucheon/sosa
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/bucheon/ojeong
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/gwangmyeong
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/pyeongtaek
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/dongducheon
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/ansan
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/ansan/sangnok
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/ansan/danwon
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/goyang
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/goyang/deogyang
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/goyang/ilsandong
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/goyang/ilsanseo
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/gwacheon
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/guri
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/namyangju
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/osan
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/siheung
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/gunpo
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/uiwang
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/hanam
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/yongin
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/yongin/cheoin
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/yongin/giheung
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/yongin/suji
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/paju
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/icheon
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/anseong
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/gimpo
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/hwaseong
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/hwaseong/manse
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/hwaseong/hyohaeng
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/hwaseong/byeongjeom
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/hwaseong/dongtan
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/gwangju
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/yangju
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/pocheon
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/yeoju
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/yeoncheon
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/gapyeong
|
||||
https://weather.o2o.kr/tomorrow/gyeonggi/yangpyeong
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/cheongju
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/cheongju/sangdang
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/cheongju/seowon
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/cheongju/heungdeok
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/cheongju/cheongwon
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/chungju
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/jecheon
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/boeun
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/okcheon
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/yeongdong
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/jeungpyeong
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/jincheon
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/goesan
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/eumseong
|
||||
https://weather.o2o.kr/tomorrow/chungbuk/danyang
|
||||
https://weather.o2o.kr/tomorrow/chungnam/cheonan
|
||||
https://weather.o2o.kr/tomorrow/chungnam/cheonan/dongnam
|
||||
https://weather.o2o.kr/tomorrow/chungnam/cheonan/seobuk
|
||||
https://weather.o2o.kr/tomorrow/chungnam/gongju
|
||||
https://weather.o2o.kr/tomorrow/chungnam/boryeong
|
||||
https://weather.o2o.kr/tomorrow/chungnam/asan
|
||||
https://weather.o2o.kr/tomorrow/chungnam/seosan
|
||||
https://weather.o2o.kr/tomorrow/chungnam/nonsan
|
||||
https://weather.o2o.kr/tomorrow/chungnam/gyeryong
|
||||
https://weather.o2o.kr/tomorrow/chungnam/dangjin
|
||||
https://weather.o2o.kr/tomorrow/chungnam/geumsan
|
||||
https://weather.o2o.kr/tomorrow/chungnam/buyeo
|
||||
https://weather.o2o.kr/tomorrow/chungnam/seocheon
|
||||
https://weather.o2o.kr/tomorrow/chungnam/cheongyang
|
||||
https://weather.o2o.kr/tomorrow/chungnam/hongseong
|
||||
https://weather.o2o.kr/tomorrow/chungnam/yesan
|
||||
https://weather.o2o.kr/tomorrow/chungnam/taean
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/pohang
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/pohang/nam
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/pohang/buk
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/gyeongju
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/gimcheon
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/andong
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/gumi
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/yeongju
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/yeongcheon
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/sangju
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/mungyeong
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/gyeongsan
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/uiseong
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/cheongsong
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/yeongyang
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/yeongdeok
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/cheongdo
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/goryeong
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/seongju
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/chilgok
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/yecheon
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/bonghwa
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/uljin
|
||||
https://weather.o2o.kr/tomorrow/gyeongbuk/ulleung
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/changwon
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/changwon/uichang
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/changwon/seongsan
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/changwon/masanhappo
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/changwon/masanhoewon
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/changwon/jinhae
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/jinju
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/tongyeong
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/sacheon
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/gimhae
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/miryang
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/geoje
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/yangsan
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/uiryeong
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/haman
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/changnyeong
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/goseong
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/namhae
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/hadong
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/sancheong
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/hamyang
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/geochang
|
||||
https://weather.o2o.kr/tomorrow/gyeongnam/hapcheon
|
||||
https://weather.o2o.kr/tomorrow/jeju/jeju
|
||||
https://weather.o2o.kr/tomorrow/jeju/seogwipo
|
||||
https://weather.o2o.kr/tomorrow/gangwon/chuncheon
|
||||
https://weather.o2o.kr/tomorrow/gangwon/wonju
|
||||
https://weather.o2o.kr/tomorrow/gangwon/gangneung
|
||||
https://weather.o2o.kr/tomorrow/gangwon/donghae
|
||||
https://weather.o2o.kr/tomorrow/gangwon/taebaek
|
||||
https://weather.o2o.kr/tomorrow/gangwon/sokcho
|
||||
https://weather.o2o.kr/tomorrow/gangwon/samcheok
|
||||
https://weather.o2o.kr/tomorrow/gangwon/hongcheon
|
||||
https://weather.o2o.kr/tomorrow/gangwon/hoengseong
|
||||
https://weather.o2o.kr/tomorrow/gangwon/yeongwol
|
||||
https://weather.o2o.kr/tomorrow/gangwon/pyeongchang
|
||||
https://weather.o2o.kr/tomorrow/gangwon/jeongseon
|
||||
https://weather.o2o.kr/tomorrow/gangwon/cheorwon
|
||||
https://weather.o2o.kr/tomorrow/gangwon/hwacheon
|
||||
https://weather.o2o.kr/tomorrow/gangwon/yanggu
|
||||
https://weather.o2o.kr/tomorrow/gangwon/inje
|
||||
https://weather.o2o.kr/tomorrow/gangwon/goseong
|
||||
https://weather.o2o.kr/tomorrow/gangwon/yangyang
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/jeonju
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/jeonju/wansan
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/jeonju/deokjin
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/gunsan
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/iksan
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/jeongeup
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/namwon
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/gimje
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/wanju
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/jinan
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/muju
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/jangsu
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/imsil
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/sunchang
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/gochang
|
||||
https://weather.o2o.kr/tomorrow/jeonbuk/buan
|
||||
@@ -0,0 +1,599 @@
|
||||
# 검색 노출
|
||||
|
||||
날씨각(weather.o2o.kr)이 구글·네이버 검색에 어떻게 잡히게 만들었는지, 근거로 삼는 공식 문서, 매일 잰 순위를 모은 문서입니다.
|
||||
|
||||
| 장 | 내용 |
|
||||
|---|---|
|
||||
| 1 | 지역 페이지 구조 (주소, 서버가 채우는 오늘 날씨, 요약·사이트 이름) |
|
||||
| 2 | 태그·키워드 (메타 태그, 해시태그, 구조화 데이터) |
|
||||
| 3 | 검색어 인기 리서치 |
|
||||
| 4 | 구글 검색 정책 (공식 문서만) |
|
||||
| 5 | 노출 기록 (`/seo-daily`가 매일 적음) |
|
||||
|
||||
---
|
||||
|
||||
## 1. 지역 페이지 구조
|
||||
|
||||
기준: 2026-10-14 작업, 운영 반영 `ba94a38` (https://weather.o2o.kr)
|
||||
|
||||
### 1-1. 지역별 주소와 페이지 (검색에 지역별 날씨 페이지가 잡히지 않음)
|
||||
|
||||
- **문제**: 다른 날씨 사이트처럼 "성남시 날씨" 같은 검색에 우리 페이지가 따로 뜨지 않았다.
|
||||
- **원인**
|
||||
- 사이트가 SPA 한 장이라, 검색엔진에는 모든 주소가 같은 제목과 같은 본문으로 보였다.
|
||||
- 지역별 주소도 없었다.
|
||||
- **해결** (`feat/region-seo-pages`)
|
||||
- 빌드할 때 지역 페이지 HTML 230장을 만든다 (`frontend/vite.config.ts`).
|
||||
- `sitemap.xml`도 빌드가 자동으로 만든다. 주소는 235개다.
|
||||
- 주소: `/today/{시도}/{시군구}`. 예: `/today/gyeonggi/seongnam`, `/today/seoul/mapo`
|
||||
- **페이지 단위를 이렇게 정했다**
|
||||
- 우리 날씨 데이터는 구 단위뿐이다.
|
||||
- 구로 나뉜 13개 시는 시 페이지 하나로 묶었다: 수원·성남·고양·용인·화성·부천·안산·안양·창원·청주·포항·전주·천안. 사람들은 "성남 날씨"로 검색하지 "중원구 날씨"로는 덜 찾는다.
|
||||
- 시 페이지는 시청이 있는 구의 날씨를 보여 준다. 위치를 이미 허용했고 그 시 안에 있으면 지금 있는 구를 보여 준다.
|
||||
- 나머지(서울·광역시의 구, 군, 일반 시)는 지금 단위 그대로 페이지를 만든다.
|
||||
- 중구·동구·고성군처럼 이름이 겹치는 곳이 있어서 주소 앞에 시도를 붙였다.
|
||||
- **앱 동작** (`frontend/src/b/region.tsx`)
|
||||
- 지역 주소로 들어오면 그 지역을 보여 준다. 위치 권한은 묻지 않고 저장된 선택도 덮어쓰지 않는다.
|
||||
- 지역 페이지에서 다른 지역을 고르면 주소도 그 지역 주소로 바뀐다.
|
||||
- `/`로 들어오면 예전 그대로다.
|
||||
- **지역 목록이 바뀌면**: `python backend/scripts/gen_region_pages.py`를 실행해 `frontend/seo/region.json`을 다시 만든다.
|
||||
- **매일 돌릴 스케줄은 필요 없다**: 주소와 소개 글은 그대로이고, 그날 값은 요청이 올 때 채운다.
|
||||
|
||||
### 1-2. 검색 결과에 오늘 날씨 넣기 (검색 결과에 실제 날씨가 안 보임)
|
||||
|
||||
- **문제**
|
||||
- AccuWeather·weather.com은 검색 결과 요약에 기온·습도 같은 실제 값이 보인다.
|
||||
- 우리 정적 페이지에는 고정 소개 글만 있었다.
|
||||
- **원인**: 정적 HTML에는 그날 값이 들어갈 수 없다.
|
||||
- **해결 (가벼운 SSR)**
|
||||
- nginx가 `/today/...` 요청을 백엔드로 넘긴다 (`frontend/nginx.conf`).
|
||||
- 백엔드는 정적 HTML을 받아 와서 설명 메타와 본문에 오늘 값을 채운다 (`backend/services/seo_service.py`, `/v1/seo/today/{sido}/{place}`). React 화면은 지금처럼 브라우저에서 그린다.
|
||||
- 피드 캐시를 그대로 써서 추가 계산은 없다.
|
||||
- 백엔드가 응답하지 않거나 오류가 나면 정적 HTML을 그대로 보여 준다.
|
||||
- **검색어에 맞춘 제목과 요약**
|
||||
```
|
||||
성남시 오늘 날씨, 뭐 할까? · 경기 | 날씨각
|
||||
최저 9°·최고 19°, 강수확률 0%, 맑음. 지금 15°, 습도 보통·자외선 낮음·미세먼지 좋음. 아침은 드라이브각, 낮은 빨래각, 저녁은 자전거각, 밤은 러닝각. 해 지는 시각 오후 5시 57분.
|
||||
```
|
||||
- **상태**: 운영 반영. 백엔드를 끈 상태에서 정적 HTML로 돌아가는 것도 로컬에서 확인했다.
|
||||
|
||||
### 1-3. 검색 결과 요약에서 게시물 글 빼기 ("날씨각" 검색 결과 요약에 게시물 글이 나옴)
|
||||
|
||||
- **문제**: "날씨각"으로 검색하면 요약에 "날씨각포근한 빗속, 우산 돌리며…"처럼 게시물 문장이 나왔다.
|
||||
- **원인**
|
||||
- 구글은 JS로 그려진 화면도 읽는다.
|
||||
- 게시물마다 작성자 이름 "날씨각" 바로 뒤에 그날 문장이 붙어 있다. 그래서 검색어 "날씨각"과 맞는 그 부분을 요약으로 뽑았다.
|
||||
- **해결**
|
||||
- 처음에는 게시물 카드에만 `data-nosnippet`을 달았다.
|
||||
- 색인된 지역 페이지 요약에 시간대 칸("9시 : 낮음…")과 행사 장소·기간도 섞여 나왔다. 그래서 앱 영역 전체(`#root`, `#boot`)에 `data-nosnippet`을 달았다 (`frontend/index.html`, `0d6ab29`). 이제 요약은 description(지역 페이지는 서버가 채운 오늘 날씨)을 쓴다.
|
||||
- React가 뜨면 서버가 채운 `<main>` 글은 지워지기 때문에, 요약에 쓸 글은 description뿐이다.
|
||||
- 홈 설명이 "날씨각은 …"으로 시작하게 바꿨다.
|
||||
- **상태**: 운영 반영. 구글이 다시 읽어 가야 검색 결과가 바뀐다.
|
||||
|
||||
### 1-4. 사이트 이름 (사이트 이름이 "에이아이오투오"로 나옴)
|
||||
|
||||
- **원인**: 구글이 사이트 이름을 상위 도메인 `o2o.kr`(회사)의 이름으로 잡은 것으로 보인다.
|
||||
- **해결**
|
||||
- 우리 쪽에 필요한 표시는 이미 다 있다: 구조화 데이터 `WebSite` name "날씨각", `og:site_name`, "날씨각"으로 시작하는 제목.
|
||||
- 코드로 바로 바꿀 수는 없다. 서치콘솔에서 홈을 색인 요청하고 몇 주 기다린다.
|
||||
- **상태**: 대기
|
||||
|
||||
### 1-5. 지역 HTML을 미리 만들지 않는 이유
|
||||
|
||||
2026-10-20 설계 검토 결론입니다.
|
||||
|
||||
- Next.js로 바꾸거나 Node 서버를 늘 띄워 둘 필요 없다. 이미 돌고 있는 Python 백엔드가 요청을 받을 때 HTML을 채운다.
|
||||
- 3시간마다 256개 지역의 HTML 파일을 미리 다시 만드는 방식은 쓰지 않는다. 이유는 다음과 같다.
|
||||
- 아무도 보지 않는 지역까지 매번 만들게 된다. 단기예보만 쳐도 하루 약 1,800회(224칸 × 8회) 기상청을 불러야 한다.
|
||||
- worker와 frontend 컨테이너가 같은 폴더를 함께 써야 하고, 다시 만들다 실패했을 때 처리할 일이 따로 생긴다.
|
||||
- 요청할 때 만들면 피드와 같은 캐시 키를 쓰므로, 사용자가 보는 숫자와 HTML 숫자가 같다.
|
||||
|
||||
---
|
||||
|
||||
## 2. 태그·키워드
|
||||
|
||||
검색 등록을 위해 넣은 HTML 태그, 검색어, 해시태그 사전을 정리한 문서입니다. (10/8 회의 결정: 넣은 태그·키워드는 정의서로 정리해 대표 보고)
|
||||
|
||||
- 기준: 2026년 10월 12일
|
||||
- 적용 파일: `frontend/index.html`, `frontend/public/robots.txt`, `frontend/public/sitemap.xml`
|
||||
- 상태: ○ 들어가 있음 · △ 문구 검토 중 · ✕ 없음
|
||||
|
||||
### 2-1. 검색·공유용 HTML 태그
|
||||
|
||||
| 태그 | 내용 | 상태 |
|
||||
|---|---|:---:|
|
||||
| `<title>` | 날씨각 · 오늘 날씨 지수, 노을, 주말 행사 | ○ |
|
||||
| description | 세차각·빨래각·러닝각처럼 오늘 날씨에 맞는 일을 점수로. 노을이 예쁜 시간과 명소, 이번 주말 가까운 축제까지 날씨각에서 확인하세요. | ○ |
|
||||
| keywords | 2-2의 검색어 15개, 쉼표로 구분 | △ |
|
||||
| canonical | https://weather.o2o.kr/ | ○ |
|
||||
| og:site_name | 날씨각 | ○ |
|
||||
| og:title / og:description | title, description과 같음 | ○ |
|
||||
| og:type / og:locale | website / ko_KR | ○ |
|
||||
| og:url | https://weather.o2o.kr/ | ○ |
|
||||
| og:image (+ 크기) | /og.png, 1200×630 | ○ |
|
||||
| og:image:alt | 날씨각, 오늘 날씨에 맞는 일을 점수로 알려 주는 서비스 | △ |
|
||||
| twitter:card | summary_large_image | ○ |
|
||||
| twitter:title / description / image | og 값과 같음 | △ |
|
||||
| 구글 소유 확인 | google-site-verification | ○ |
|
||||
| 네이버 소유 확인 | naver-site-verification | ○ |
|
||||
| theme-color | #d6ebff | ○ |
|
||||
| manifest | 이름 '날씨각', 색 #d6ebff | △ |
|
||||
|
||||
### 2-2. 검색어 (keywords 메타)
|
||||
|
||||
검색엔진이 사이트 주제를 파악하는 데 참고합니다. 구글은 거의 보지 않고 다음 등 일부가 참고합니다.
|
||||
|
||||
날씨각, 오늘 날씨, 날씨 지수, 세차하기 좋은 날, 빨래하기 좋은 날, 러닝하기 좋은 날씨, 오늘 노을, 노을 시간, 일몰 시간, 노을 명소, 주말 날씨, 주말 나들이, 이번 주말 축제, 미세먼지, 오늘 밤 달
|
||||
|
||||
### 2-3. 해시태그 사전
|
||||
|
||||
서비스 주제를 분류하는 기준 단어입니다. HTML 태그와는 별개이며, SNS 게시물, 블로그 글, 검색 광고 키워드, 앞으로 만들 검색용 페이지 이름에 같은 말을 씁니다. 2-2 검색어는 이 사전에서 골랐습니다.
|
||||
|
||||
| 분류 | 해시태그 |
|
||||
|---|---|
|
||||
| 기본 | #날씨각 #오늘날씨 #동네날씨 #날씨지수 |
|
||||
| 오늘의 각 | #세차각 #빨래각 #러닝각 #피크닉각 #산책각 #캠핑각 #등산각 #야장각 #치맥각 #별보기각 |
|
||||
| 노을·하늘 | #오늘노을 #노을시간 #일몰시간 #노을명소 #골든아워 #블루아워 #오늘밤달 |
|
||||
| 주말·행사 | #주말날씨 #주말나들이 #당일치기 #이번주말축제 #전시 #공연 #팝업스토어 |
|
||||
| 생활 날씨 | #미세먼지 #체감온도 #불쾌지수 #기상특보 |
|
||||
| 계절·상식 | #계절소식 #날씨상식 |
|
||||
|
||||
총 34개. 각은 34개 중 검색이 많을 만한 10개만 넣었습니다(전체 목록은 `backend/docs/각_계산기준.md`).
|
||||
|
||||
### 2-4. 구조화 데이터 (JSON-LD)
|
||||
|
||||
검색엔진과 AI가 사이트를 정확히 이해하도록 넣는 데이터입니다. 화면에는 보이지 않습니다.
|
||||
|
||||
| 종류 | 내용 | 상태 |
|
||||
|---|---|:---:|
|
||||
| WebSite | 이름 날씨각, 주소, 한국어 | ○ |
|
||||
| WebApplication | 날씨 분류, 무료, 한국어 | △ |
|
||||
| Organization | 운영사 이름(날씨각 또는 회사명, 결정 필요), 주소 | △ |
|
||||
| FAQPage | `/faq` 정적 페이지에만 넣음. 원본 `frontend/seo/faq.json` (날씨별 추천·각 기준·이용 안내 20개). 지역 페이지는 본문에 지역 FAQ 5개만 넣고 구조화 데이터는 안 넣음 (앱이 뜨면 사람에겐 안 보이는 글이라) | ○ |
|
||||
|
||||
### 2-5. 로봇용 소개 본문
|
||||
|
||||
네이버 로봇과 AI 크롤러는 화면을 그리는 스크립트를 실행하지 않아 메타 태그만 읽습니다. 그래서 앱이 뜨기 전 HTML에 서비스 소개 글(오늘의 각, 노을, 주말·행사, 계절·상식)을 넣고, 앱이 뜨면 화면으로 바뀌게 합니다. 상태: △
|
||||
|
||||
### 2-6. 검색 등록 현황
|
||||
|
||||
| 할 일 | 상태 |
|
||||
|---|:---:|
|
||||
| robots.txt (모든 로봇 허용, sitemap 위치) | ○ |
|
||||
| sitemap.xml (메인 주소 한 줄) | ○ |
|
||||
| 구글 서치 콘솔 등록·sitemap 제출 | 배포 뒤 |
|
||||
| 네이버 서치어드바이저 소유 확인·sitemap 제출 | 배포 뒤 |
|
||||
|
||||
---
|
||||
|
||||
## 3. 검색어 인기 리서치
|
||||
|
||||
조사일: 2026-10-20
|
||||
방법: 구글 트렌드(한국, 최근 12개월 평균, '세차'=100 기준 상대값), 구글·네이버 자동완성.
|
||||
한계: 구글 트렌드는 표본 값이라 같은 검색어도 묶음마다 수치가 2배까지 달라졌다(이번주 날씨 32·69). 자릿수로만 본다. 한국은 네이버 비중이 커서 네이버 실제 검색량(네이버 검색광고 키워드 도구, 광고 계정 필요)으로 다시 확인해야 한다.
|
||||
|
||||
### 구글 트렌드 상대 검색량 ('세차'=100)
|
||||
|
||||
| 묶음 | 검색어 = 값 |
|
||||
|---|---|
|
||||
| 날씨 일반 | 내일 날씨 ≈ 10,000 · 오늘 날씨 384 · 서울 날씨 295 · 이번주 날씨 32~69 · 주말 날씨 15 |
|
||||
| 지역 | 인천 날씨 80 · 수원 날씨 31 · 성남 날씨 7 · 강남 날씨 4 · 분당 날씨 2 · 마포구 날씨 0 · 판교 날씨 0 |
|
||||
| 생활 | 우산 181 · 빨래 160 · 미세먼지 156 · 노을 82 · 옷차림 82 · 일몰 시간 50 |
|
||||
| 활동+날씨 | 캠핑 날씨 1 · 러닝 날씨 1 · 날씨 좋은 날 1 · 세차 날씨 0 · 빨래 날씨 0 |
|
||||
|
||||
- '날씨'·'오늘 날씨'를 같은 묶음에 넣으면 나머지가 모두 0으로 반올림됐다. '날씨' 단독 검색이 압도적으로 많다.
|
||||
|
||||
### 자동완성 (사람들이 실제로 붙여 치는 말)
|
||||
|
||||
- 오늘 날씨: 구글 — 판교·성남·서울 / 네이버 — 서울·부산·인천·대전·대구, **오늘 날씨 옷차림**
|
||||
- 분당 날씨: 내일 분당 날씨, 오늘 분당 날씨, 이번주 분당 날씨, 현재 분당 날씨, 분당 날씨 비·강수량
|
||||
- 주말 날씨: 네이버 — **이번주말 날씨**, 서울·대구·대전·제주 주말 날씨, 다음주 주말 날씨
|
||||
- 날씨 좋은 날: 갈만한 곳, 카페, 산책, 드라이브, 데이트
|
||||
- 러닝 날씨: 복장, 옷 / 캠핑 날씨: 어플, 10월·11월 캠핑 날씨
|
||||
- 노을: 네이버 — 노을 지는 시간
|
||||
- 세차·빨래: 세차장·세차용품, 빨래방·건조대·쉰내 — 날씨와 붙여 치는 말은 자동완성에 없음
|
||||
|
||||
### 판단
|
||||
|
||||
- 사람이 많이 치는 꼴은 "지역 + 날씨"와 "내일/오늘/이번주(말) 날씨"다. 우리 지역 주소가 받아야 할 검색어가 이쪽이다.
|
||||
- 지역은 큰 시가 많다(인천·수원 > 성남 > 분당·강남). 구 단위('마포구 날씨', '판교 날씨')는 구글에서 거의 0이라, 구 주소는 "시 주소가 못 받는 동네 검색" 보조로 본다.
|
||||
- '세차각'·'세차 날씨'·'빨래 날씨'처럼 활동+날씨 검색은 거의 없다. 각 이름으로 검색 유입을 기대하긴 어렵고, 검색은 지역 날씨로 들어오게 하고 각은 들어온 뒤 차별점으로 쓰는 게 맞다.
|
||||
- 시간 표현은 '내일'이 '오늘'보다 훨씬 많다. 우리 지역 페이지는 제목이 "오늘 날씨"뿐이라 '내일 OO 날씨'를 받을 내용이 없다 → 내일 예보·내일 각을 페이지에 넣을지 기획 결정 필요.
|
||||
- '옷차림'(오늘 날씨 옷차림)·'우산'·'미세먼지'·'노을 지는 시간'은 날씨각이 이미 다루는 주제와 맞닿고 검색량이 세차보다 많다. 후보로 둔다.
|
||||
|
||||
### 다음에 확인할 것
|
||||
|
||||
- 네이버 검색광고 키워드 도구로 위 검색어의 네이버 월간 검색 수(PC·모바일) 확인 — https://searchad.naver.com
|
||||
- 네이버 데이터랩 검색어 트렌드로 계절 변화 확인 — https://datalab.naver.com/keyword/trendSearch.naver
|
||||
|
||||
---
|
||||
|
||||
## 4. 구글 검색 정책
|
||||
|
||||
조사일: 2026-10-19 (사이트 이름, 방문자 수·광고와 순위는 2026-10-20 추가)
|
||||
원칙: 공식 문서에 적힌 것만 쓴다. 문장 끝 `[번호]`는 이 장 맨 아래 출처 번호다. 문서에 없는 건 "문서에 없음"으로 따로 적었다.
|
||||
|
||||
### 4-0. 채널별로 어떤 규칙을 따르나
|
||||
|
||||
날씨각은 채널마다 사용자가 찾아오는 곳과 순위를 정하는 주체가 다르다. 이 장의 4-1~4-5(구글 검색 정책)는 **웹** 칸에만 해당한다.
|
||||
|
||||
| 채널 | 사용자가 찾는 곳 | 순위·노출을 정하는 것 (공식 문서) | 구글 검색 정책 적용 |
|
||||
|---|---|---|---|
|
||||
| 웹 (weather.o2o.kr, 지역 페이지 `/today/…`) | 구글 검색 | 의미·관련성·품질·사용성·맥락(위치) [2]. 링크와 sitemap으로 페이지를 찾는다 [1] | 적용 (4-1~4-5) |
|
||||
| 안드로이드 앱 · Wear OS 워치 앱/워치 페이스 (`watch/`) | Google Play 검색 | 평점·리뷰·다운로드 수 등 여러 요인이 함께 작용한다. 비중은 공개하지 않는다 [8] | 앱 안의 화면은 웹이 아니다. 앱 화면이 **내가 가진 웹페이지와 대응하고** Android App Links(딥링크 + 웹사이트 소유 확인)를 설정하면, 구글 검색 결과에서 앱으로 바로 열 수 있다 [9] |
|
||||
| 토스 인앱 (앱인토스 미니앱) | 토스 앱 안 검색, 공유 링크, 미니앱 스토어·전체탭 | 출시 → 추천 → 부스팅 3단계. 추천은 UX·실사용 지표(재방문율·전환율)·리뷰·성능 네 가지를 모두 충족해야 하고, 검색 결과에서 우선 노출된다 [10] | 미니앱이 구글 검색에 색인되는지는 **문서에 없음** [10][11] |
|
||||
| 알림 (앱 푸시 등) | 검색으로 찾는 대상이 아님 | — | 구글 검색은 웹페이지를 크롤링·색인한다 [1]. 알림 정책은 각 앱 플랫폼(Play, 토스) 문서를 따로 봐야 하며, 이 문서에서는 조사하지 않았다 |
|
||||
|
||||
- 앱인토스 노출 정책 시행일은 "10월 22일"로만 적혀 있고 연도는 없다. [10]
|
||||
- 토스 미니앱 검색 키워드가 순위를 어떻게 정하는지는 문서에 없다. 추천 미니앱이 "검색 결과에서 우선 노출"된다는 문장만 있다. [10]
|
||||
- 구글 Play 문서는 제목을 고유하고 앱 내용을 분명히 보여 주게 쓰라고 권하지만, 제목이 순위 요인이라고 적지는 않았다. [8]
|
||||
|
||||
### 4-1. 구글 검색이 동작하는 단계
|
||||
|
||||
- 구글은 크롤링 → 색인 → 검색 결과 제공의 세 단계로 동작한다. [1]
|
||||
- 크롤링: Googlebot이 페이지를 찾아 내려받는다. 찾은 페이지를 모두 크롤링하지는 않는다. [1]
|
||||
- 색인: 페이지 내용을 분석하고, 거의 같은 페이지는 묶어서 대표 페이지(canonical)를 정한다. 색인된다는 보장은 없다. [1]
|
||||
- 검색 결과 제공: 색인에서 가장 관련 있고 품질 높다고 판단한 페이지를 보여 준다. [1]
|
||||
- 구글은 페이지를 두 가지 방법으로 찾는다. 이미 아는 페이지의 **링크**를 따라가거나, 사이트 주인이 낸 **sitemap**을 읽는다. [1]
|
||||
- 돈을 받고 더 자주 크롤링하거나 순위를 올려 주지 않는다. 순위는 프로그램이 정한다. [1]
|
||||
|
||||
### 4-2. 순위를 정할 때 보는 신호
|
||||
|
||||
검색어에 따라 각 신호의 비중이 달라진다. [2]
|
||||
|
||||
| 신호 | 내용 |
|
||||
|---|---|
|
||||
| 의미 | 검색어의 의도를 파악한다. 오타 교정, 비슷한 말 처리 포함 [2] |
|
||||
| 관련성 | 페이지의 제목·본문이 검색어와 맞는지 본다 [2] |
|
||||
| 품질 | 전문성·권위·신뢰를 본다. 다른 유명 사이트가 링크를 거는지가 예시로 나온다 [2] |
|
||||
| 사용성 | 다른 조건이 비슷하면 모바일에서 잘 보이고 빠른 페이지가 유리할 수 있다 [2] |
|
||||
| 맥락 | 위치, 언어, 검색 기록, 설정으로 결과를 맞춘다 [2] |
|
||||
|
||||
#### 위치
|
||||
|
||||
- 구글은 사용자 위치 같은 정보로 무엇이 가장 관련 있는지 정한다. [2]
|
||||
- 많은 검색어에 지역 의도가 있음을 알아본다. 예: '피자'를 치면 근처 배달 가게, 런던에서 'football'을 치면 축구 결과. [2]
|
||||
- 같은 검색어도 사용자 위치·언어·기기에 따라 결과가 다르다. 예: '자전거 수리점'은 파리와 홍콩에서 결과가 다르다. [1]
|
||||
|
||||
#### 날씨
|
||||
|
||||
- **한국과 일본에서는 구글 날씨 예보를 제공하지 않는다.** [6]
|
||||
- 다른 나라에서 구글 날씨 예보는 각국 기상기관(NOAA, ECMWF, Met Office 등)의 모델과 관측을 쓰는 구글 자체 예보 시스템으로 만든다. [6]
|
||||
|
||||
#### 광고비를 내면 순위가 오르나 → 아니다
|
||||
|
||||
- "검색 결과는 검색어만으로 정해지고, 기업·개인·단체가 광고를 사는지에 영향받지 않는다." [2]
|
||||
- "검색 알고리즘이 순위를 매길 때 광고주를 특별 대우하지 않으며, 누구도 그렇게 해 달라고 돈을 낼 수 없다." [2]
|
||||
- 검색 목록에 넣어 주는 데 돈을 받지 않는다. 광고나 관계없는 사업 제휴 같은 개인적·금전적 관계로 순위를 올려 주지 않는다. [13]
|
||||
- "구글 검색 결과는 구글 광고 프로그램과 독립돼 있다." [14]
|
||||
- 정리: 구글 광고(Google Ads)를 하면 광고 칸에 따로 뜰 뿐, 그 아래 일반 검색 결과 순위는 오르지 않는다.
|
||||
|
||||
#### 방문자가 많으면 순위가 오르나 → 문서에 그런 말은 없다
|
||||
|
||||
- 사이트 방문자 수(트래픽)를 순위 신호로 쓴다는 문장은 공식 문서에 없다.
|
||||
- 문서에 있는 것: "검색 결과가 검색어와 관련 있는지 평가하려고, 모아서 익명 처리한 상호작용 데이터를 쓴다." [2] 검색 결과에서 사람들이 어떻게 반응하는지를 관련성 평가에 쓴다는 말이고, 방문자 수를 그대로 순위에 쓴다는 말은 아니다.
|
||||
- 인기와 가까운 신호로 문서에 나오는 것은 링크다: 품질을 볼 때 "다른 유명 사이트가 그 콘텐츠를 링크하거나 언급하는지"를 본다. [2] 링크로 페이지가 무엇에 대한 것인지·얼마나 도움이 되는지 판단한다. [3]
|
||||
|
||||
#### 그럼 상위에 오르는 건 무엇으로 정해지나 (문서 기준)
|
||||
|
||||
- 검색어 의도에 맞는지(의미), 제목·본문에 검색어와 같은 말이 있는지(관련성), 도움이 되는 내용인지·다른 사이트가 링크·언급하는지(품질), 보기 쉬운지(사용성), 검색한 사람 위치·언어(맥락). 검색어마다 비중이 다르다. [2]
|
||||
- 검색 결과 다른 페이지들과 비교해 충분한 가치를 주는지, 자기만의 정보가 있는지를 스스로 점검하라고 한다. [15]
|
||||
- 판단(우리에게 적용): '분당구 오늘 날씨'는 제목·본문에 '분당구'가 있는 구 주소가 있어야 관련성에서 경쟁할 수 있다(10/20 구 주소 39장 배포). 그다음은 각 점수처럼 다른 날씨 사이트에 없는 정보, 그리고 다른 사이트의 링크·언급이다. 광고비나 방문자 수로 올리는 길은 문서상 없다.
|
||||
|
||||
### 4-3. 구글이 공개한 순위 시스템
|
||||
|
||||
[3]에 나온 것 중 우리와 관련 있는 것만 적었다.
|
||||
|
||||
| 시스템 | 내용 |
|
||||
|---|---|
|
||||
| BERT, RankBrain, Neural matching | 검색어와 페이지의 뜻을 이해한다. 검색어 단어가 그대로 없어도 관련 페이지를 찾는다 [3] |
|
||||
| Passage ranking | 페이지의 개별 구간도 따로 평가한다 [3] |
|
||||
| Freshness | 최신 내용이 필요한 검색어에는 새 내용을 보여 준다 [3] |
|
||||
| Link analysis, PageRank | 페이지끼리의 링크로 무엇에 대한 페이지인지, 얼마나 도움이 되는지 판단한다 [3] |
|
||||
| Exact match domain | 검색어와 똑같이 만든 도메인에 주는 점수를 제한한다 [3] |
|
||||
| Reliable information | 권위 있는 페이지를 올리고 품질 낮은 내용을 내린다 [3] |
|
||||
| Original content | 원본 내용을 인용만 한 페이지보다 우선한다 [3] |
|
||||
| Site diversity | 상위 결과에 같은 사이트는 보통 2개까지만 보여 준다 [3] |
|
||||
| Deduplication | 매우 비슷한 페이지가 많으면 가장 관련 있는 것만 보여 준다 [3] |
|
||||
| Spam detection (SpamBrain) | 스팸을 찾는다. 정기적으로 업데이트된다 [3] |
|
||||
| Helpful content | 2024년 3월부터 핵심 순위 시스템에 포함됐다 [3] |
|
||||
|
||||
### 4-4. 스팸 정책 (우리와 관련 있는 것)
|
||||
|
||||
#### 관문 페이지 (Doorway abuse)
|
||||
|
||||
- 정의: 비슷한 특정 검색어로 순위를 얻으려고 만든 사이트나 페이지. [4]
|
||||
- 예시: 특정 지역이나 도시를 노린 도메인·페이지를 여러 개 만들어 한 페이지로 몰아가는 것. [4]
|
||||
|
||||
#### 대량 생성 (Scaled content abuse)
|
||||
|
||||
- 정의: 주로 검색 순위를 조작하려고 많은 페이지를 만드는 것. [4]
|
||||
- 예시: 생성형 AI 같은 도구로 사용자에게 가치를 더하지 않는 페이지를 많이 만드는 것. [4]
|
||||
|
||||
#### 숨긴 텍스트·링크 (Hidden text and link abuse)
|
||||
|
||||
- 정의: 검색엔진만을 위해 페이지에 내용을 넣는 것. [4]
|
||||
- 예시: 흰 배경에 흰 글씨, 이미지 뒤에 숨기기, CSS로 화면 밖에 두기, 글자 크기나 투명도를 0으로, 작은 글자 하나에만 링크 걸기. [4]
|
||||
- 위반이 아닌 것: 탭·아코디언처럼 눌러서 펼치는 내용, 슬라이드, 마우스를 올리면 나오는 툴팁, 스크린리더 전용 텍스트. [4]
|
||||
- 고치는 방법: URL 검사 도구로 구글에는 보이고 사람에게는 안 보이는 내용을 찾아, 사람과 크롤러가 똑같이 볼 수 있게 지우거나 스타일을 바꾼다. [5]
|
||||
|
||||
#### 위반했을 때
|
||||
|
||||
- 정책을 위반한 사이트는 순위가 내려가거나 검색 결과에 아예 나오지 않을 수 있다. [4]
|
||||
- 구글은 자동 시스템과, 필요하면 사람 검토로 위반을 찾는다. 사람 검토는 수동 조치로 이어질 수 있다. [4]
|
||||
- 수동 조치: 구글 직원이 정책 위반이라고 판단해 내리는 조치다. [5]
|
||||
- 알림: 서치 콘솔의 "수동 조치" 보고서와 메시지 센터로 온다. [5]
|
||||
- 범위: 일부 페이지 또는 사이트 전체. [5]
|
||||
- 결과: 순위가 내려가거나 결과에서 빠진다. 사용자에게는 아무 표시가 없다. [5]
|
||||
- 일부 페이지만 고치면 일부만 복구되지 않는다. [5]
|
||||
- 복구: 해당 페이지를 모두 고친 뒤 "검토 요청"을 보낸다. 검토에 며칠에서 몇 주 걸린다. 검토 중에는 다시 보내지 않는다. [5]
|
||||
|
||||
### 4-5. 지도·지역 업체 순위 (참고)
|
||||
|
||||
웹페이지가 아니라 Google 비즈니스 프로필(지도의 가게 목록) 기준이다.
|
||||
|
||||
- 관련성: 프로필이 검색어와 얼마나 맞는지. [7]
|
||||
- 거리: 검색하는 사람과 업체 사이의 거리. 위치를 공유하지 않았으면 구글이 아는 위치 정보를 쓴다. [7]
|
||||
- 인지도: 얼마나 잘 알려졌는지. 다른 사이트의 링크, 리뷰 수와 평점이 포함된다. [7]
|
||||
|
||||
### 4-6. 사이트 이름 (검색 결과에 링크 위에 붙는 이름)
|
||||
|
||||
- 사이트 이름은 구글이 자동으로 정한다. 홈페이지 내용과 웹에서 그 사이트를 가리키는 언급을 함께 본다. [12]
|
||||
- 구글이 보는 곳: 홈의 `WebSite` 구조화 데이터, `og:site_name`, `<title>`, 제목 태그(h1 등) 등. [12]
|
||||
- 도메인(o2o.kr)과 서브도메인(weather.o2o.kr) 단위로 각각 정할 수 있다. 하위 경로(o2o.kr/weather) 단위는 안 된다. [12]
|
||||
- 서브도메인 홈에 구조화 데이터가 없으면, 상위 도메인의 사이트 이름을 대신 쓸 수 있다. [12]
|
||||
- `WebSite` 구조화 데이터는 홈에 있어야 한다. 필수는 `name`, `url`. `alternateName`은 선택이고 여러 개를 선호 순서대로 적을 수 있다. [12]
|
||||
- 구글은 자동으로 정한 이름을 사람이 직접 바꿔 주지 않는다. [12]
|
||||
- 원하는 이름이 안 나올 때 문서가 권하는 것: [12]
|
||||
- 구조화 데이터와 홈의 다른 이름 표기(제목, og 등)가 서로 맞는지 확인
|
||||
- 리디렉션, http·https 버전 모두 같은 이름인지 확인
|
||||
- 서치 콘솔에서 홈 재크롤링 요청. 반영까지 며칠에서 몇 주.
|
||||
- 그래도 안 되면 `alternateName`에 도메인 이름(소문자)을 넣어 대체 이름으로 둔다. 도메인 이름을 대표 이름으로 쓰는 건 마지막 수단.
|
||||
- 사이트 이름이 순위에 영향을 주는지는 문서에 없다. 문서에 적힌 목적은 "각 결과의 출처를 잘 나타내는 것"뿐이다. [12]
|
||||
|
||||
#### 우리 상황 (2026-10-20 확인)
|
||||
|
||||
- 구글 '날씨각' 검색 결과에 weather.o2o.kr 사이트 이름이 '날씨각'이 아니라 '에이아이오투오'로 나온다.
|
||||
- weather.o2o.kr 홈: `WebSite` 구조화 데이터 `name` "날씨각", `alternateName` "날씨 각"·"Nalssigak", `og:site_name` "날씨각", `<title>` "날씨각 · …"으로 모두 같다.
|
||||
- o2o.kr 홈의 `<title>`은 "에이아이오투오"다.
|
||||
- 판단(문서에 없는 추정): 구글이 weather.o2o.kr의 이름을 아직 정하지 못해 상위 도메인 o2o.kr 이름을 쓰고 있을 가능성이 크다. 확인 방법은 서치 콘솔 URL 검사로 홈의 구조화 데이터가 인식됐는지 보는 것.
|
||||
- 판단: 순위 영향은 문서에 없다. 다만 '날씨각'을 검색한 사람에게 다른 이름이 보이면 우리 사이트인지 알아보기 어렵다. 할 일은 서치 콘솔에서 홈 재크롤링 요청 후 몇 주 지켜보는 것.
|
||||
|
||||
### 4-7. 공식 문서에 없는 것
|
||||
|
||||
- 앱(JS)이 뜨면서 화면에서 사라지는 첫 HTML 속 링크·텍스트가 숨긴 텍스트 위반인지는 문서에 없다. 위반 예시에도, 예외에도 없다.
|
||||
- '오늘 날씨' 같은 검색어에 구글이 사용자 위치를 어떻게 붙여 검색하는지 구체적인 방식은 문서에 없다. 문서에는 "위치를 쓴다", "지역 의도를 알아본다"까지만 있다. [2]
|
||||
- 새 페이지가 순위에 오르기까지 걸리는 기간은 문서에 없다.
|
||||
- 사이트 이름이 순위에 영향을 주는지는 문서에 없다. [12]
|
||||
- 사이트 방문자 수가 순위에 영향을 주는지는 문서에 없다. 있는 건 검색 결과에 대한 상호작용 데이터를 관련성 평가에 쓴다는 문장뿐이다. [2]
|
||||
|
||||
### 4-8. 직접 확인한 검색 결과 (2026-10-19, 구글, 한국어·한국 설정)
|
||||
|
||||
공식 문서가 아니라 한 번 직접 검색해 본 결과다. 사람·위치·시간마다 다를 수 있다.
|
||||
|
||||
- '날씨각': weather.o2o.kr 홈이 3위. 1위는 성남 AccuWeather(검색한 위치가 성남으로 잡힘), 2위는 기상청.
|
||||
- `site:weather.o2o.kr`: 홈, `/week`, `/gak`, `/season`과 지역 페이지 일부(광주 남구, 서울 중구, 동해, 이천, 완도, 영동)가 색인돼 있음.
|
||||
- '성남 날씨각', '완도 날씨각': 10위 안에 없음. 두 검색 모두 결과에 "누락된 검색어: 각"이 표시됨.
|
||||
- 2026-10-20 재확인: '날씨각' 3위 그대로, 사이트 이름은 '에이아이오투오'. '마포구 오늘 날씨'·'마포구 날씨'·'강남구 오늘 날씨'·'오늘 날씨'·'세차하기 좋은 날'·'오늘 노을 시간'은 20위 안에 없음.
|
||||
- 서버 로그(지난 7일): Googlebot이 지역 페이지 235개 중 39개를 가져감. sitemap은 2번 가져감.
|
||||
|
||||
### 4-9. 출처
|
||||
|
||||
1. [How Google Search works — Google Search Central](https://developers.google.com/search/docs/fundamentals/how-search-works)
|
||||
2. [Ranking results — How Search Works](https://www.google.com/search/howsearchworks/how-search-works/ranking-results/)
|
||||
3. [A guide to Google Search ranking systems — Google Search Central](https://developers.google.com/search/docs/appearance/ranking-systems-guide)
|
||||
4. [Spam policies for Google web search — Google Search Central](https://developers.google.com/search/docs/essentials/spam-policies)
|
||||
5. [Manual actions report — Search Console 도움말](https://support.google.com/webmasters/answer/9044175)
|
||||
6. [Forecast information on Google Weather — Google 검색 도움말](https://support.google.com/websearch/answer/13687874)
|
||||
7. [How Google determines local ranking — Google 비즈니스 프로필 도움말](https://support.google.com/business/answer/7091)
|
||||
8. [Google Play에서 앱 검색·발견 — Play Console 도움말](https://support.google.com/googleplay/android-developer/answer/4448378?hl=ko)
|
||||
9. [Enable app content for Google Search (App Links) — Android Developers](https://developer.android.com/training/app-indexing)
|
||||
10. [미니앱 노출 정책 — 앱인토스 개발자 문서](https://developers-apps-in-toss.toss.im/guide/exposure)
|
||||
11. [앱인토스란 — 앱인토스 개발자 문서](https://developers-apps-in-toss.toss.im/intro/overview.html)
|
||||
12. [Provide a site name to Google Search — Google Search Central](https://developers.google.com/search/docs/appearance/site-names) (2025-12-10 갱신)
|
||||
13. [Our approach to Search — How Search Works](https://www.google.com/search/howsearchworks/our-approach/)
|
||||
14. [How Google search results differ from ads — Google Ads 도움말](https://support.google.com/google-ads/answer/1722080)
|
||||
15. [Creating helpful, reliable, people-first content — Google Search Central](https://developers.google.com/search/docs/fundamentals/creating-helpful-content) (2026-10-05 갱신)
|
||||
|
||||
---
|
||||
|
||||
## 5. 노출 기록
|
||||
|
||||
순위 = 결과에서 weather.o2o.kr이 몇 번째 사이트인지(같은 사이트는 한 번만 셈). `-` 첫 페이지에 없음. 적힌 검색어만 나온 것, 나머지는 `-`.
|
||||
구글은 첫 페이지(사이트 6~9개)만 본다. 로그인한 브라우저·위치(성남) 기준.
|
||||
|
||||
### 최근 요약 (10/30, 직전 10/29 대비)
|
||||
|
||||
- 새로 잡힘: 없음
|
||||
- 빠짐: 없음 (10/29에 빠진 `성남 오늘 날씨`·`고양 내일 날씨`·`수원 오늘 날씨`는 구글·네이버 모두 여전히 -)
|
||||
- 순위 바뀜: 없음 — `날씨각` 네이버 1 그대로(첫 링크가 `/` → `/tomorrow/incheon/namdong`으로 바뀜), 구글은 `제주 날씨`부터 CAPTCHA로 `날씨각` 포함 16개 못 잼
|
||||
|
||||
### 지난 요약 (10/29, 직전 측정 대비 — 구글은 10/27, 네이버는 10/28)
|
||||
|
||||
- 새로 잡힘: 없음
|
||||
- 빠짐: `성남 오늘 날씨` → 구글 2p8→-, 네이버 10→-. `고양 내일 날씨` → 구글 2p7→-. `수원 오늘 날씨` → 네이버 14→-. (구글 `site:weather.o2o.kr 성남` 은 9건 나와 색인은 살아 있음)
|
||||
- 순위 바뀜: 없음 (`날씨각` 구글 1p1·네이버 1 그대로)
|
||||
|
||||
### 지난 요약 (10/28, 직전 10/27 대비)
|
||||
|
||||
- 새로 잡힘: `수원 오늘 날씨` → 네이버 14 (`/today/gyeonggi/suwon`)
|
||||
- 순위 바뀜: `성남 오늘 날씨` → 네이버 6→10 (떨어짐)
|
||||
- 빠짐: 네이버 없음. 구글은 측정 실패(검색 결과 대신 JavaScript 안내 페이지 → 곧 CAPTCHA), `날씨각` 1p1만 확인
|
||||
|
||||
### 지난 요약 (10/27, 직전 10/26 대비)
|
||||
|
||||
- 새로 잡힘: `고양 내일 날씨` → 구글 2p7 (`/tomorrow/gyeonggi/goyang`)
|
||||
- 순위 바뀜: `성남 오늘 날씨` → 구글 2p10→2p8, 네이버 10→6
|
||||
- 빠짐: 없음 (`군산 오늘 날씨` 구글 3p4는 차단으로 못 잼)
|
||||
|
||||
### 지난 요약 (10/26, 직전 10/24 대비)
|
||||
|
||||
- 개선: 구글 **날씨각 3→1위**, 색인 약 383→421. 구 39개 중 2p 안 34→35개, **청원 2p1→1p6**(구 페이지 첫 1페이지 유지), 처인 -→2p2. 네이버 site: 첫 화면 15→16(성남 추가), `송파구 내일 날씨` 14위로 처음 나옴(오늘 페이지).
|
||||
- 악화: 구글 만세 1p6→2p1, 기흥·동탄·포항 남·북 여전히 2p 밖. 네이버 `강남구 오늘 날씨` 5→8(±5 안, 잡음 범위).
|
||||
- 그대로: 네이버 날씨각 1, 서울·인천 7개 구 5~15위. 네이버 구 39개 0, 군산 내일 구글 1~4p 없음(군산 오늘은 로그인 3p4로 처음 잡힘).
|
||||
|
||||
### 대표 검색어 순위
|
||||
|
||||
실제 검색량이 큰 검색어 78개 + 날씨각. 구글 = 로그인 브라우저·성남 위치, 1~2페이지. 네이버 = 통합검색·웹 탭 첫 화면. `-` = 없음, `?` = 구글 차단으로 못 잼.
|
||||
|
||||
| 검색어 | 구글 10/26 | 구글 10/27 | 구글 10/28 | 구글 10/29 | 구글 10/30 | 네이버 10/26 | 네이버 10/27 | 네이버 10/28 | 네이버 10/29 | 네이버 10/30 |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| 날씨각 | 1p1 | 1p1 | 1p1 | 1p1 | ? | 1 | 1 | 1 | 1 | 1 `/tomorrow/incheon/namdong` |
|
||||
| 성남 오늘 날씨 | 2p10 `/today/gyeonggi/seongnam` | 2p8 | ? | - | - | 10 | 6 | 10 | - | - |
|
||||
| 수원 오늘 날씨 | - | - | ? | - | - | - | - | 14 `/today/gyeonggi/suwon` | - | - |
|
||||
| 고양 내일 날씨 | - | 2p7 `/tomorrow/gyeonggi/goyang` | ? | - | - | - | - | - | - | - |
|
||||
| 군산 오늘 날씨 | 3p4 (2p 밖) | ? | ? | - | - | - | - | - | - | - |
|
||||
| 오늘 날씨 · 내일 날씨 · 모레 날씨 · 이번주 날씨 · 주말 날씨 · 날씨 | - | - | ? | - | - | - | - | - | - | - |
|
||||
| 서울 · 부산 · 인천 · 대전 · 광주 · 울산 · 세종 × 오늘/내일/날씨, 수원 내일·수원 날씨, 대구 날씨, 성남 내일·성남 날씨 | - | - | ? | - | - | - | - | - | - | - |
|
||||
| 대구 오늘 날씨 · 대구 내일 날씨 | - | ? | ? | - | - | - | - | - | - | - |
|
||||
| 고양 오늘·고양 날씨, 용인 · 창원 · 청주 · 천안 · 전주 × 오늘/내일/날씨 | - | - | ? | - | - | - | - | - | - | - |
|
||||
| 군산 내일·군산 날씨, 포항 · 제주 · 김해 · 화성 · 부천 · 안산 · 남양주 × 오늘/내일/날씨 | - | ? | ? | - | - (제주 날씨·김해·화성·부천·안산·남양주는 ?) | - | - | - | - | - |
|
||||
|
||||
- 서울·부산·인천·대구·대전·광주·울산은 시 단위 페이지가 없음(구 페이지만). '서울 날씨'를 받을 페이지 자체가 없다.
|
||||
- 원본: `docs/search_log/{날짜}_naver_대표검색어.tsv`
|
||||
- 10/30 구글: 탭에서 열어 63개까지 잼, `제주 날씨`에서 CAPTCHA(sorry)로 멈춤. 나머지 16개(`날씨각` 포함)는 `?`.
|
||||
- 10/28 구글: 브라우저 fetch 로 받은 검색 결과가 'JavaScript 필요' 안내 페이지로 바뀌어 결과를 못 읽었고, 탭에서 직접 열자 CAPTCHA(sorry)가 떠 멈춤. 다음 측정은 탭에서 실제 페이지를 열어 읽는 방식으로 해야 함.
|
||||
|
||||
### 키워드별 잡힘 (10/26)
|
||||
|
||||
숫자 = 순위(사이트 기준). 구글 `2p4` = 2페이지 4번째.
|
||||
|
||||
#### 네이버 (171개 중 18개 잡힘)
|
||||
|
||||
| 키워드 | 잡힘 |
|
||||
|---|---|
|
||||
| 날씨각 · 날씨각 성남 | O 1 |
|
||||
| 성남 오늘 날씨 | O 11 |
|
||||
| 송파구 내일 날씨 | O 14 (오늘 페이지) |
|
||||
| `{구} 오늘 날씨` | O 연수·구로·마포·성동·송파 6 · 강남 8 · 부평 9 |
|
||||
| `오늘 {구} 날씨` | O 송파 6 · 연수·성동 8 · 강남·마포 9 · 구로 10 · 부평 15 |
|
||||
| 위 7개 구 `{구} 날씨` · `{구} 내일 날씨`(송파 빼고) | X |
|
||||
| 나머지 지역(분당·수원·서울 중구·광주 남구·이천·완도·동해·시흥·김해·춘천·수성구·화성·군산·제주·청주 상당·용인 처인·전주 완산·포항 남·해운대·노원·관악) 4가지 꼴 전부 | X |
|
||||
| 경기 등 구 39개 `오늘 {구} 날씨` | X (0개) |
|
||||
| 일반: 날씨 각 · 내일 날씨 · 오늘 일몰 시간 · 노을 시간 · 세차/빨래/등산/캠핑 날씨 · 산책하기 좋은 날씨 · 오늘 우산 필요 · 미세먼지 오늘 | X (전부) |
|
||||
|
||||
#### 구글 (2페이지까지, 46개)
|
||||
|
||||
| 키워드 | 잡힘 |
|
||||
|---|---|
|
||||
| 날씨각 | O 1p1 |
|
||||
| 청원구 오늘 날씨 | O 1p6 |
|
||||
| `{구} 오늘 날씨` 34개 (수원 4구, 성남 수정·중원·분당, 안양·부천·안산·고양·화성 구, 처인·수지, 청주·천안·창원·전주 구) | O 2p (구별 순위는 아래 '구글 구 39개 표') |
|
||||
| 성동구 내일 날씨 | O 2p4 |
|
||||
| 분당구 내일 날씨 | O 2p7 (오늘 페이지) |
|
||||
| 군산 오늘 날씨 | O 3p4 |
|
||||
| 기흥구 · 동탄구 · 포항 남구 · 포항 북구 오늘 날씨 | X (2p 밖) |
|
||||
| 군산 내일 날씨 | X (1~4p 없음) |
|
||||
| 오늘 날씨 · 세차/빨래 날씨 · 노을 시간 등 일반, 서울 구 | 안 봄 (30개 넘게 치면 막혀서 뺌) |
|
||||
|
||||
### 검색어 묶음
|
||||
|
||||
- 기본: 날씨각 · 오늘 날씨 · 분당구 오늘 날씨 · 분당 날씨 · 성남 오늘 날씨 · 마포구 오늘 날씨 · 마포구 날씨 · 강남구 오늘 날씨 · 세차하기 좋은 날 · 빨래하기 좋은 날 · 오늘 노을 시간 · 이번 주말 날씨 · 세차각
|
||||
- 지역(10/20~): 아래 29곳 × `{지역} 날씨` · `{지역} 오늘 날씨` · `오늘 {지역} 날씨`
|
||||
분당구 성남 수원 부평구 연수구 강남구 구로구 마포구 성동구 송파구 / 서울 중구 광주 남구 이천 완도 동해 시흥 김해 춘천 수성구 화성 군산 제주 / 청주 상당구 용인 처인구 전주 완산구 포항 남구 해운대구 노원구 관악구
|
||||
- 일반(10/20~): 날씨 각 · 날씨각 성남 · 오늘 일몰 시간 · 노을 시간 · 세차 날씨 · 빨래 날씨 · 등산 날씨 · 캠핑 날씨 · 산책하기 좋은 날씨 · 오늘 우산 필요 · 미세먼지 오늘
|
||||
|
||||
### 기록
|
||||
|
||||
| 날짜 | 엔진 | 범위 | 나온 검색어 (순위 · 주소) | 색인 수 | 비고 |
|
||||
|---|---|---|---|---|---|
|
||||
| 10/19 | 구글 | 기본 | 날씨각 3 | 약 10 | 사이트 이름 '에이아이오투오' |
|
||||
| 10/19 | 네이버 | 기본 | 날씨각 1, 마포구 오늘 날씨 9 | 10 | |
|
||||
| 10/20 | 구글 | 기본 | 날씨각 3 | | 사이트 이름 '에이아이오투오' |
|
||||
| 10/20 | 네이버 | 기본 | 날씨각 1, 마포구 오늘 날씨 약 11, 강남구 오늘 날씨 약 6 | 10 | 분당·성남 3개 차단 |
|
||||
| 10/20 밤 | 구글 | 기본+분당구·성남 날씨 | 날씨각 2 | 51 (`/today` 47, 구 주소 5) | 구 주소 색인: 분당·청주 상당·용인 처인·전주 완산·포항 남 |
|
||||
| 10/20 밤 | 네이버 | 지역+일반 98개 | 날씨각 성남 1 `/today/gyeonggi/seongnam`, 부평구 오늘 6, 연수구 오늘 6, 강남구 오늘 6, 구로구 오늘 7, 성동구 오늘 7, 송파구 오늘 8, 마포구 오늘 12 | 10 | 색인: 홈·성남·수원·부평·연수·강남·구로·마포·성동·송파 |
|
||||
| 10/21 | 구글 | 기본 2개 + 지역 11곳(분당구~서울 중구) | 날씨각 4 | | 37번째부터 막힘, 나머지 66개 못 봄 |
|
||||
| 10/21 | 구글 | 구 39개 `오늘 {구} 날씨` (1~2페이지) | 구 주소로 25개: 장안·권선·팔달·영통·수정·만안·동안·원미·소사·덕양·일산동·일산서·수지·효행(1페이지)·병점·동탄·상당·서원·흥덕·청원·천안서북·의창·성산·완산·덕진. 시 주소로 2개: 중원→`/seongnam`, 만세→`/hwaseong` | 구 39개 모두 색인 | 없음 12개: 분당(2p에 보였다 안 보였다)·오정·상록·단원·처인·기흥·천안동남·포항남·포항북·마산합포·마산회원·진해 |
|
||||
| 10/21 | 네이버 | 구 39개 `오늘 {구} 날씨` | 0개 | 구 주소 색인 0 | |
|
||||
| 10/21 | 네이버 | 지역+일반 98개 | 날씨각 성남 1, 강남구 오늘 4, 연수구 오늘 5, 구로구 오늘 6, 날씨 각 6 `/`, 송파구 오늘 8, 마포구 오늘 10, 부평구 오늘 14 | | 성동구 오늘 빠짐 |
|
||||
| 10/23 | 구글 | 10/21 없던 구 12개 `오늘 {구} 날씨`(1~2p) + 분당 + 내일 5개 + 날씨각 | 2p로 들어옴 7개: 오정 4·상록 6·단원 4·기흥 8(`/tomorrow/` 주소)·천안동남 7·마산합포 5·분당 6. `내일 날씨 뭐 할까` **1p 4위** `/tomorrow/gyeonggi/seongnam`. 날씨각 2 | 약 347 (10/20 51) | 여전히 없음 5개: 처인·포항남·포항북·마산회원·진해. `분당구·성남·수원·강남구 내일 날씨` 1p 없음. 1p는 전부 0 |
|
||||
| 10/23 | 네이버 | 지역 29곳×4꼴(`내일` 추가) + 일반 13 + 구 39개 `오늘 {구} 날씨` (168개) | 날씨각 **1** (새로 나옴), 날씨각 성남 1, `{구} 오늘 날씨`: 부평 5·강남 5·성동 5·연수 6·구로 6·마포 6·송파 7, `오늘 {구} 날씨`(10/21엔 0): 성동 6·부평 7·강남 7·구로 10·마포 10·송파 10·연수 11 | 16 이상 (10/21 10) | 새 색인: 서울 종로·중구·용산, /sky·/week·/season. 경기 등 구 39개 여전히 0, `내일 날씨` 꼴 0 |
|
||||
| 10/24 | 구글 | 구 39개 `{구} 오늘 날씨`(1~2p) + 날씨각 + 내일 4개 | 39개 중 34개 나옴(10/23 24개 중 21개). **만세 1p6** (구 페이지 첫 1페이지). 청원·효행 2p1. 날씨각 3 `/today/gyeonggi/seongnam`(10/23 2). 성동구 내일 2p3 `/tomorrow/seoul/seongdong`, 분당구 내일 2p6(오늘 페이지). 군산 내일 1~5p 없음(로그인) / 시크릿 4p, 군산 오늘 시크릿 3p(사용자 확인) | 약 383 (10/23 347) | 없음 5개: 처인·기흥·동탄·포항남·포항북 |
|
||||
| 10/24 | 네이버 | 10/23과 같은 168개 + 내일 4개 | 날씨각 1, 날씨각 성남 1, **성남 오늘 날씨 10 (새로 나옴)**. `{구} 오늘 날씨`: 강남 5·성동 6·구로 6·마포 6·연수 7·송파 7·부평 11. `오늘 {구} 날씨`: 성동 5·강남 6·송파 7·마포 9·연수 10·구로 12·부평 14 | site: 첫 화면 15 (10/23 16, 같은 수준) | 구 39개 0, `내일 날씨` 꼴 0(성동구·군산 포함). 부평은 뉴스 칸 영향으로 ±5 흔들림 |
|
||||
| 10/26 | 구글 | 10/24와 같은 범위(구 39개 1~2p + 날씨각 + 내일 3개·군산 오늘) | **날씨각 1** `/`(10/24 3). 39개 중 35개 나옴(10/24 34). **청원 1p6**, 만세 1p6→2p1, 효행 2p1, 처인 2p2(새로). 성동구 내일 2p4 `/tomorrow/seoul/seongdong`(10/24 2p3), 분당구 내일 2p7(오늘 페이지). 군산 내일 1~4p 없음, 군산 오늘 3p4 `/today/jeonbuk/gunsan`(로그인 첫 확인) | 약 421 (10/24 383) | 없음 4개: 기흥·동탄·포항남·포항북. 막힘(sorry) 없음 |
|
||||
| 10/26 | 네이버 | 10/24와 같은 172개 | 날씨각 1, 날씨각 성남 1, 성남 오늘 날씨 11(10/24 10). `{구} 오늘 날씨`: 연수 6·구로 6·마포 6·성동 6·송파 6·강남 8·부평 9. `오늘 {구} 날씨`: 송파 6·연수 8·성동 8·강남 9·마포 9·구로 10·부평 15. **송파구 내일 날씨 14 (새로 나옴, 오늘 페이지)** | site: 첫 화면 16 (10/24 15, 성남 추가) | 구 39개 0, 나머지 `내일 날씨` 꼴 0 |
|
||||
| 11/10 | 구글 | 날씨각 · `"날씨각"` · `site:` 3개 | 날씨각 **-** (1p 8곳: 기상청·AccuWeather·케이웨더·웨더아이·다음·수도권기상청·네이버·weather.com, "누락된 검색어: 각"). `"날씨각"` 도 - | **약 3** (10/26 약 421): `/tomorrow/gyeonggi/ansan/sangnok`, `/today/seoul/jung`, `/today/gyeonggi/seongnam/jungwon`. 홈 없음 | 사이트 이름 '에이아이오투오'·'AIO2O'. `site:o2o.kr` 약 135(triplepick 정상). Googlebot 응답은 전부 200, 지역 페이지 수집은 11일간 9번. 서치 콘솔은 로그인 계정에 권한 없어 못 봄 |
|
||||
| 11/10 | 네이버 | 날씨각 · `site:` | 날씨각 1 `/` | site: 첫 화면 30 이상 (홈·faq·gak·game·saju·season·sky·shorts 9·today 7) | 정상 |
|
||||
| 11/13 | 구글 | 기본 13개 + `"날씨각"` + `site:` (탭 안 fetch, 막힘 없음) | 전부 **-** (날씨각 1p 7곳: AccuWeather·웨더아이·기상청·케이웨더·kma·weather.com·네이버, "누락된 검색어: 각") | **약 2** (11/10 약 3): `/tomorrow/gyeonggi/ansan/sangnok`, `/today/gyeonggi/seongnam/jungwon`. 홈 없음 | 같은 날 사이트맵을 566 → 11개로 줄여 배포·서치 콘솔 재제출(발견된 페이지 11, 읽은 날짜 11/13). 배포 뒤 Googlebot 은 robots.txt 2·sitemap.xml 1 만 가져감 |
|
||||
| 11/13 | 네이버 | 기본 13개 + 구 6개(수원·송파·성동·연수·구로·부평 오늘 날씨) + `site:` | 날씨각 1 `/`, 세차각 2 `/gak`, 오늘 노을 시간 4 `/`, 성동구 오늘 7, 구로구 오늘 10, **분당구 오늘 날씨 12·분당 날씨 17 (새로, 내일 페이지 `/tomorrow/gyeonggi/seongnam/bundang`)**. 빠짐(10/26 대비): 마포구 오늘 6→-, 강남구 오늘 8→-, 송파구 오늘 6→-, 연수구 오늘 6→-, 부평구 오늘 9→- | site: 첫 화면 31 (홈·faq·gak·game·saju·sky·week, faq 시도 7, shorts 11, today 6) | 빠진 5개 구는 `site:weather.o2o.kr {구}` 에 주소가 있고 Yeti UA 200·제목 정상 → 색인이 아니라 순위. 직전 측정이 10/26 이라 18일 사이 언제 빠졌는지는 모름. 원본 `docs/search_log/2026-11-13_naver.tsv` |
|
||||
|
||||
### 11/10 구글 색인 급감 원인 분석
|
||||
|
||||
- **상태**: 구글 `날씨각` 1p1(10/29) → 없음. 서치 콘솔 색인 46 / 미색인 523 (크롤링됨 - 현재 색인이 생성되지 않음 327, 발견됨 - 현재 색인이 생성되지 않음 193, 표준 태그가 포함된 대체 페이지 3). 홈도 "크롤링됨 - 현재 색인이 생성되지 않음". 수동 조치·보안 문제 없음. 네이버는 정상(날씨각 1).
|
||||
- **배제**: 서버 응답(Googlebot 261건 전부 200), robots.txt·noindex·canonical, 렌더 실패(Googlebot UA 헤드리스 렌더 정상), 도메인 전체 문제(triplepick.o2o.kr 정상 색인).
|
||||
- **가설(추정, 구글이 사유를 알려 주지 않음)**
|
||||
- 모든 페이지의 닫힌 지역 바꾸기 창 안에 "○○ 오늘 날씨" 링크 269개가 숨어 있었다(10/19 `0a16c53`, 로봇용). 4-4 숨긴 텍스트·링크 정의("검색엔진만을 위해 넣는 내용")에 가깝다.
|
||||
- 틀이 같은 지역 페이지를 사이트맵 235 → 566개로 단기간에 늘렸다.
|
||||
- **조치**: 숨은 링크 묶음 제거(`fix/remove-hidden-region-links`, `frontend/src/b/Sheets.tsx`). 지역 페이지는 사이트맵, 지역 페이지 하단 소개 글의 같은 시도 링크, `/faq` → 시도 FAQ 로 발견된다. 홈에서 지역 페이지로 가는 링크는 없어진다(홈 하단 `/faq` 링크는 넣지 않기로 함).
|
||||
- **서치 콘솔에서 확인한 흐름 (11/10, 날짜는 서치 콘솔 기준 = 태평양 시간)**
|
||||
- 색인 보고서: 10/17~19 색인 약 77·미색인 약 195 → 10/20~23 색인 약 369·미색인 약 190 → 10/24부터 색인 46·미색인 523 (막대 높이로 읽은 근삿값, 최종 업데이트 11/6).
|
||||
- "크롤링됨 - 현재 색인이 생성되지 않음" 327개: 내일 237·오늘 70·FAQ 16·홈·`/gak`·`/week`·`/season`. 마지막 크롤링이 10/22 231개, 10/23 41개.
|
||||
- 실적: 노출 10/22 2,203 → 10/23 21,045 → 10/24 17,956 → 10/25 17,062 → 10/26 14,368 → 10/27 12,200 → **10/28 36** → 10/31 이후 0~2. 28일 합계 클릭 58·노출 8.64만·평균 9.2위.
|
||||
- 노출 대부분이 일반 검색어: `내일 날씨` 56,790(9.0위, 클릭 21), `날씨` 7,492, `성남시 날씨` 6,082, `익산시 날씨` 3,777. 홈은 노출 106·클릭 20·3.5위.
|
||||
- 홈 URL 검사: 11/10 12:03 크롤링(배포 전), "크롤링됨 - 현재 색인이 생성되지 않음", 수동 조치 없음. 배포 뒤 14:12 실시간 테스트는 "URL을 Google에 등록할 수 있음", 구글이 렌더한 HTML에 숨은 링크 묶음 0·게시물 카드 52·"불러오는 중" 0.
|
||||
- 배포 이력(서버 `git reflog`): 10/27 12번 이상, 10/28 8번, 10/29 13번, 10/30 12번. 10/30 15:03 배포(`4b321c1`) 전에는 배포마다 예전 빌드 파일이 지워져, 구글이 먼저 받아 둔 HTML 로 나중에 렌더하면 '날씨 불러오는 중'에서 멈출 수 있었다.
|
||||
- **가설 추가(추정)**: ① 10/23~27 일반 검색어 9위권에 시험 노출됐다가 클릭률 0.1%로 재평가돼 빠짐. ② 10/27~30 잦은 배포로 구글 렌더가 빈 화면을 봄(10/30 수정됨). 숨은 링크·페이지 대량 추가와 함께 어느 것이 결정적이었는지는 가릴 수 없다.
|
||||
- **11/13 사이트맵 줄이기**: 지역 오늘 페이지(`/today/…`)·내일 페이지(`/tomorrow/…`)·시도별 FAQ(`/faq/{시도}`)를 사이트맵에서 뺐다(`frontend/vite.config.ts`). 사이트맵에는 홈과 `/faq`·`/gak` 같은 기본 페이지만 남는다. 페이지는 그대로 열리고 noindex 는 넣지 않았다. 지역 페이지는 `/faq` → 시도 FAQ → 지역 페이지 링크로만 발견된다.
|
||||
- **미결정**: 지역 페이지·시도별 FAQ 에 noindex 를 넣을지. 배포 뒤 몇 주 색인 비율을 보고 정한다.
|
||||
|
||||
### 구글 구 39개 표
|
||||
|
||||
`2p6` = 2페이지 6번째 사이트. `내일` = 내일 페이지(`/tomorrow/`)가 나옴, `시` = 구 대신 시 페이지. `-` = 2페이지 안에 없음, 빈칸 = 안 봄.
|
||||
|
||||
| 구 | 10/21 `오늘 {구} 날씨` | 10/23 `오늘 {구} 날씨` | 10/23 `{구} 오늘 날씨` | 10/24 `{구} 오늘 날씨` | 10/26 `{구} 오늘 날씨` |
|
||||
|---|---|---|---|---|---|
|
||||
| 수원 장안 | 2p | | 2p6 | 2p7 내일 | 2p7 |
|
||||
| 수원 권선 | 2p | | 2p7 | 2p8 | 2p7 |
|
||||
| 수원 팔달 | 2p | | 2p6 내일 | 2p5 | 2p6 |
|
||||
| 수원 영통 | 2p | | 2p5 내일 | 2p6 | 2p6 |
|
||||
| 성남 수정 | 2p | | 2p7 시 | 2p2 | 2p3 |
|
||||
| 성남 중원 | 2p 시 | | 2p6 시 | 2p7 시 | 2p6 시 |
|
||||
| 성남 분당 | - | 2p6 | 2p4 | 2p3 | 2p5 |
|
||||
| 안양 만안 | 2p | | 2p5 | 2p6 | 2p4 |
|
||||
| 안양 동안 | 2p | | 2p6 내일 | 2p5 내일 | 2p5 내일 |
|
||||
| 부천 원미 | 2p | | 2p6 | 2p6 | 2p4 |
|
||||
| 부천 소사 | 2p | | 2p5 | 2p4 | 2p4 |
|
||||
| 부천 오정 | - | 2p4 | 2p2 내일 | 2p3 내일 | 2p5 |
|
||||
| 안산 상록 | - | 2p6 | 2p6 | 2p8 | 2p8 |
|
||||
| 안산 단원 | - | 2p4 | - | 2p8 | 2p9 |
|
||||
| 고양 덕양 | 2p | | 2p6 | 2p5 내일 | 2p5 내일 |
|
||||
| 고양 일산동 | 2p | | 2p5 | 2p6 내일 | 2p5 |
|
||||
| 고양 일산서 | 2p | | - | 2p6 | 2p6 |
|
||||
| 용인 처인 | - | - | 2p8 | - | 2p2 |
|
||||
| 용인 기흥 | - | 2p8 내일 | - | - | - |
|
||||
| 용인 수지 | 2p | | 2p7 | 2p7 | 2p8 |
|
||||
| 화성 만세 | 2p 시 | | 2p3 | **1p6** | 2p1 |
|
||||
| 화성 효행 | **1p** | | 2p1 내일 | 2p1 | 2p1 |
|
||||
| 화성 병점 | 2p | | 2p4 | 2p5 | 2p5 |
|
||||
| 화성 동탄 | 2p | | 2p7 내일 | - | - |
|
||||
| 청주 상당 | 2p | | | 2p7 | 2p7 |
|
||||
| 청주 서원 | 2p | | | 2p6 | 2p5 |
|
||||
| 청주 흥덕 | 2p | | | 2p5 | 2p4 |
|
||||
| 청주 청원 | 2p | | | 2p1 | **1p6** |
|
||||
| 천안 동남 | - | 2p7 | | 2p5 | 2p3 |
|
||||
| 천안 서북 | 2p | | | 2p4 | 2p5 |
|
||||
| 포항 남 | - | - | | - | - |
|
||||
| 포항 북 | - | - | | - | - |
|
||||
| 창원 의창 | 2p | | | 2p6 | 2p6 |
|
||||
| 창원 성산 | 2p | | | 2p5 | 2p5 |
|
||||
| 창원 마산합포 | - | 2p5 | | 2p6 | 2p6 |
|
||||
| 창원 마산회원 | - | - | | 2p4 | 2p5 |
|
||||
| 창원 진해 | - | - | | 2p6 내일 | 2p6 내일 |
|
||||
| 전주 완산 | 2p | | | 2p5 | 2p6 |
|
||||
| 전주 덕진 | 2p | | | 2p6 | 2p5 |
|
||||
|
||||
### 메모
|
||||
|
||||
- 네이버는 `{구} 오늘 날씨` 꼴에서만 나온다. 같은 구라도 `{구} 날씨`·`오늘 {구} 날씨`는 안 나온다.
|
||||
- 네이버는 색인된 9곳 밖 지역이 나올 수 없다. 성남·수원은 색인돼 있어도 안 나온다.
|
||||
- 구글은 브라우저 fetch로 30여 개 치면 막힌다(결과 대신 확인 화면 → 보안문자). 하루 30개 안쪽으로 나눠 치거나 서치 콘솔 실적 보고서로 본다.
|
||||
- 10/21 구글 '오늘 분당구 날씨' **2페이지**에 `/today/gyeonggi/seongnam/bundang`(제목 '분당구 오늘 날씨, 뭐 할까? · 성남시') 나옴. 사용자 화면 2번째, 내 화면 9번째. 10/20 배포한 구 주소가 하루 만에 잡힘. 첫 페이지만 보는 테스트로는 놓친다 → 2페이지까지 본다.
|
||||
- 10/21 떨어진 것 확인: 우리 페이지(제목·설명·canonical)는 그대로, 네이버 색인 10개도 그대로(성동·부평 포함). 부평구 오늘 6→14는 위에 뉴스 4곳(newsinside·wikitree·YTN·KBS)이 새로 들어옴(비 오는 날). 성동구 오늘은 결과 사이트가 9곳뿐인 판에서 빠짐, 1~9위는 기상청·웨더아이·weather.com·accuweather 등. 구글 날씨각 2→4는 위 사이트를 저장 안 해서 원인 못 봄 → 다음부터 상위 사이트도 저장.
|
||||
- 10/21 같은 날 1시간 안에 다시 쳤더니 성동구 오늘 -→6, 부평구 오늘 14→9, 강남구 4→5, 송파 8→7. 네이버는 요청마다 뉴스 칸 등 구성이 바뀌어 ±5 안팎 변동은 잡음. 하루 비교로 오르내림 판단 금지, 3일 이상 같은 방향일 때만 원인 분석.
|
||||
- 10/21 서치 콘솔 URL 검사: 구 주소 39개 모두 "URL이 Google에 등록되어 있음" → 구글은 색인 문제가 아니라 순위 문제. 색인 생성 요청 안 함.
|
||||
- 상위 사이트 목록: `docs/search_log/날짜_naver_top.tsv` (10/21, 10/23, 10/24, 10/26) (검색어 → 1~15위 호스트). 다음 날 이 파일과 비교해 누가 새로 위에 들어왔는지 본다.
|
||||
- 10/20 구글 '분당구 오늘 날씨' 1~8위는 모두 제목에 '분당구'가 있는 구 단위 페이지.
|
||||
- 10/23 서치 콘솔 URL 검사: 내일 페이지 13곳(송파·남양주·평택·강서·강남·달서·김해·시흥·파주·광진·부산진·완도·진해) 모두 "URL이 Google에 등록되어 있음" → 구글은 사이트맵으로 내일 페이지를 이미 가져감, 색인 요청 안 함. 네이버 서치어드바이저는 Claude in Chrome에서 막혀 사람이 넣어야 함(순서: `docs/search_log/색인요청_인구순.txt`).
|
||||
- 10/24 `군산 내일 날씨`: 구글 1~5페이지 없음, 네이버 통합·웹 1~3페이지 없음. 구글 `site:weather.o2o.kr 군산`엔 /faq/jeonbuk·/faq만 나오고 군산 오늘·내일 페이지는 안 나옴.
|
||||
- 10/26 성동구 내일 vs 군산 내일: 두 페이지 제목 형식·canonical·사이트맵 같음. 구글 `site:` 로 둘 다 색인 확인(10/24 사용자 계정에서도 군산 내일 색인·2p 확인. site: 결과는 색인 전체를 보여주지 않아 색인 판단에 쓰지 않음). 구글 결과 수 군산 내일 약 304,000 vs 성동구 내일 약 74,800. 성동구 내일은 2p4, 군산 내일은 2p 안 1p·2p 모두 기상청·아큐웨더·웨더아이·meteocast 등. 네이버 군산 쪽 상위엔 군산시청·뉴스(economytalk·topstarnews·jbsori) 추가.
|
||||
@@ -1,156 +0,0 @@
|
||||
# 검색 노출 기록
|
||||
|
||||
순위 = 결과에서 weather.o2o.kr이 몇 번째 사이트인지(같은 사이트는 한 번만 셈). `-` 첫 페이지에 없음. 적힌 검색어만 나온 것, 나머지는 `-`.
|
||||
구글은 첫 페이지(사이트 6~9개)만 본다. 로그인한 브라우저·위치(성남) 기준.
|
||||
|
||||
## 최근 요약 (10/27, 직전 10/26 대비)
|
||||
|
||||
- 새로 잡힘: `고양 내일 날씨` → 구글 2p7 (`/tomorrow/gyeonggi/goyang`)
|
||||
- 순위 바뀜: `성남 오늘 날씨` → 구글 2p10→2p8, 네이버 10→6
|
||||
- 빠짐: 없음 (`군산 오늘 날씨` 구글 3p4는 차단으로 못 잼)
|
||||
|
||||
## 지난 요약 (10/26, 직전 10/24 대비)
|
||||
|
||||
- 개선: 구글 **날씨각 3→1위**, 색인 약 383→421. 구 39개 중 2p 안 34→35개, **청원 2p1→1p6**(구 페이지 첫 1페이지 유지), 처인 -→2p2. 네이버 site: 첫 화면 15→16(성남 추가), `송파구 내일 날씨` 14위로 처음 나옴(오늘 페이지).
|
||||
- 악화: 구글 만세 1p6→2p1, 기흥·동탄·포항 남·북 여전히 2p 밖. 네이버 `강남구 오늘 날씨` 5→8(±5 안, 잡음 범위).
|
||||
- 그대로: 네이버 날씨각 1, 서울·인천 7개 구 5~15위. 네이버 구 39개 0, 군산 내일 구글 1~4p 없음(군산 오늘은 로그인 3p4로 처음 잡힘).
|
||||
|
||||
## 대표 검색어 순위
|
||||
|
||||
실제 검색량이 큰 검색어 78개 + 날씨각. 구글 = 로그인 브라우저·성남 위치, 1~2페이지. 네이버 = 통합검색·웹 탭 첫 화면. `-` = 없음, `?` = 구글 차단으로 못 잼.
|
||||
|
||||
| 검색어 | 구글 10/26 | 구글 10/27 | 네이버 10/26 | 네이버 10/27 |
|
||||
|---|---|---|---|---|
|
||||
| 날씨각 | 1p1 | 1p1 | 1 | 1 |
|
||||
| 성남 오늘 날씨 | 2p10 `/today/gyeonggi/seongnam` | 2p8 | 10 | 6 |
|
||||
| 고양 내일 날씨 | - | 2p7 `/tomorrow/gyeonggi/goyang` | - | - |
|
||||
| 군산 오늘 날씨 | 3p4 (2p 밖) | ? | - | - |
|
||||
| 오늘 날씨 · 내일 날씨 · 모레 날씨 · 이번주 날씨 · 주말 날씨 · 날씨 | - | - | - | - |
|
||||
| 서울 · 부산 · 인천 · 대전 · 광주 · 울산 · 세종 · 수원 × 오늘/내일/날씨, 대구 날씨, 성남 내일·성남 날씨 | - | - | - | - |
|
||||
| 대구 오늘 날씨 · 대구 내일 날씨 | - | ? | - | - |
|
||||
| 고양 오늘·고양 날씨, 용인 · 창원 · 청주 · 천안 · 전주 × 오늘/내일/날씨 | - | - | - | - |
|
||||
| 군산 내일·군산 날씨, 포항 · 제주 · 김해 · 화성 · 부천 · 안산 · 남양주 × 오늘/내일/날씨 | - | ? | - | - |
|
||||
|
||||
- 서울·부산·인천·대구·대전·광주·울산은 시 단위 페이지가 없음(구 페이지만). '서울 날씨'를 받을 페이지 자체가 없다.
|
||||
- 원본: `docs/search_log/{날짜}_naver_대표검색어.tsv`
|
||||
|
||||
## 키워드별 잡힘 (10/26)
|
||||
|
||||
숫자 = 순위(사이트 기준). 구글 `2p4` = 2페이지 4번째.
|
||||
|
||||
### 네이버 (171개 중 18개 잡힘)
|
||||
|
||||
| 키워드 | 잡힘 |
|
||||
|---|---|
|
||||
| 날씨각 · 날씨각 성남 | O 1 |
|
||||
| 성남 오늘 날씨 | O 11 |
|
||||
| 송파구 내일 날씨 | O 14 (오늘 페이지) |
|
||||
| `{구} 오늘 날씨` | O 연수·구로·마포·성동·송파 6 · 강남 8 · 부평 9 |
|
||||
| `오늘 {구} 날씨` | O 송파 6 · 연수·성동 8 · 강남·마포 9 · 구로 10 · 부평 15 |
|
||||
| 위 7개 구 `{구} 날씨` · `{구} 내일 날씨`(송파 빼고) | X |
|
||||
| 나머지 지역(분당·수원·서울 중구·광주 남구·이천·완도·동해·시흥·김해·춘천·수성구·화성·군산·제주·청주 상당·용인 처인·전주 완산·포항 남·해운대·노원·관악) 4가지 꼴 전부 | X |
|
||||
| 경기 등 구 39개 `오늘 {구} 날씨` | X (0개) |
|
||||
| 일반: 날씨 각 · 내일 날씨 · 오늘 일몰 시간 · 노을 시간 · 세차/빨래/등산/캠핑 날씨 · 산책하기 좋은 날씨 · 오늘 우산 필요 · 미세먼지 오늘 | X (전부) |
|
||||
|
||||
### 구글 (2페이지까지, 46개)
|
||||
|
||||
| 키워드 | 잡힘 |
|
||||
|---|---|
|
||||
| 날씨각 | O 1p1 |
|
||||
| 청원구 오늘 날씨 | O 1p6 |
|
||||
| `{구} 오늘 날씨` 34개 (수원 4구, 성남 수정·중원·분당, 안양·부천·안산·고양·화성 구, 처인·수지, 청주·천안·창원·전주 구) | O 2p (구별 순위는 아래 '구글 구 39개 표') |
|
||||
| 성동구 내일 날씨 | O 2p4 |
|
||||
| 분당구 내일 날씨 | O 2p7 (오늘 페이지) |
|
||||
| 군산 오늘 날씨 | O 3p4 |
|
||||
| 기흥구 · 동탄구 · 포항 남구 · 포항 북구 오늘 날씨 | X (2p 밖) |
|
||||
| 군산 내일 날씨 | X (1~4p 없음) |
|
||||
| 오늘 날씨 · 세차/빨래 날씨 · 노을 시간 등 일반, 서울 구 | 안 봄 (30개 넘게 치면 막혀서 뺌) |
|
||||
|
||||
## 검색어 묶음
|
||||
|
||||
- 기본: 날씨각 · 오늘 날씨 · 분당구 오늘 날씨 · 분당 날씨 · 성남 오늘 날씨 · 마포구 오늘 날씨 · 마포구 날씨 · 강남구 오늘 날씨 · 세차하기 좋은 날 · 빨래하기 좋은 날 · 오늘 노을 시간 · 이번 주말 날씨 · 세차각
|
||||
- 지역(10/20~): 아래 29곳 × `{지역} 날씨` · `{지역} 오늘 날씨` · `오늘 {지역} 날씨`
|
||||
분당구 성남 수원 부평구 연수구 강남구 구로구 마포구 성동구 송파구 / 서울 중구 광주 남구 이천 완도 동해 시흥 김해 춘천 수성구 화성 군산 제주 / 청주 상당구 용인 처인구 전주 완산구 포항 남구 해운대구 노원구 관악구
|
||||
- 일반(10/20~): 날씨 각 · 날씨각 성남 · 오늘 일몰 시간 · 노을 시간 · 세차 날씨 · 빨래 날씨 · 등산 날씨 · 캠핑 날씨 · 산책하기 좋은 날씨 · 오늘 우산 필요 · 미세먼지 오늘
|
||||
|
||||
## 기록
|
||||
|
||||
| 날짜 | 엔진 | 범위 | 나온 검색어 (순위 · 주소) | 색인 수 | 비고 |
|
||||
|---|---|---|---|---|---|
|
||||
| 10/19 | 구글 | 기본 | 날씨각 3 | 약 10 | 사이트 이름 '에이아이오투오' |
|
||||
| 10/19 | 네이버 | 기본 | 날씨각 1, 마포구 오늘 날씨 9 | 10 | |
|
||||
| 10/20 | 구글 | 기본 | 날씨각 3 | | 사이트 이름 '에이아이오투오' |
|
||||
| 10/20 | 네이버 | 기본 | 날씨각 1, 마포구 오늘 날씨 약 11, 강남구 오늘 날씨 약 6 | 10 | 분당·성남 3개 차단 |
|
||||
| 10/20 밤 | 구글 | 기본+분당구·성남 날씨 | 날씨각 2 | 51 (`/today` 47, 구 주소 5) | 구 주소 색인: 분당·청주 상당·용인 처인·전주 완산·포항 남 |
|
||||
| 10/20 밤 | 네이버 | 지역+일반 98개 | 날씨각 성남 1 `/today/gyeonggi/seongnam`, 부평구 오늘 6, 연수구 오늘 6, 강남구 오늘 6, 구로구 오늘 7, 성동구 오늘 7, 송파구 오늘 8, 마포구 오늘 12 | 10 | 색인: 홈·성남·수원·부평·연수·강남·구로·마포·성동·송파 |
|
||||
| 10/21 | 구글 | 기본 2개 + 지역 11곳(분당구~서울 중구) | 날씨각 4 | | 37번째부터 막힘, 나머지 66개 못 봄 |
|
||||
| 10/21 | 구글 | 구 39개 `오늘 {구} 날씨` (1~2페이지) | 구 주소로 25개: 장안·권선·팔달·영통·수정·만안·동안·원미·소사·덕양·일산동·일산서·수지·효행(1페이지)·병점·동탄·상당·서원·흥덕·청원·천안서북·의창·성산·완산·덕진. 시 주소로 2개: 중원→`/seongnam`, 만세→`/hwaseong` | 구 39개 모두 색인 | 없음 12개: 분당(2p에 보였다 안 보였다)·오정·상록·단원·처인·기흥·천안동남·포항남·포항북·마산합포·마산회원·진해 |
|
||||
| 10/21 | 네이버 | 구 39개 `오늘 {구} 날씨` | 0개 | 구 주소 색인 0 | |
|
||||
| 10/21 | 네이버 | 지역+일반 98개 | 날씨각 성남 1, 강남구 오늘 4, 연수구 오늘 5, 구로구 오늘 6, 날씨 각 6 `/`, 송파구 오늘 8, 마포구 오늘 10, 부평구 오늘 14 | | 성동구 오늘 빠짐 |
|
||||
| 10/23 | 구글 | 10/21 없던 구 12개 `오늘 {구} 날씨`(1~2p) + 분당 + 내일 5개 + 날씨각 | 2p로 들어옴 7개: 오정 4·상록 6·단원 4·기흥 8(`/tomorrow/` 주소)·천안동남 7·마산합포 5·분당 6. `내일 날씨 뭐 할까` **1p 4위** `/tomorrow/gyeonggi/seongnam`. 날씨각 2 | 약 347 (10/20 51) | 여전히 없음 5개: 처인·포항남·포항북·마산회원·진해. `분당구·성남·수원·강남구 내일 날씨` 1p 없음. 1p는 전부 0 |
|
||||
| 10/23 | 네이버 | 지역 29곳×4꼴(`내일` 추가) + 일반 13 + 구 39개 `오늘 {구} 날씨` (168개) | 날씨각 **1** (새로 나옴), 날씨각 성남 1, `{구} 오늘 날씨`: 부평 5·강남 5·성동 5·연수 6·구로 6·마포 6·송파 7, `오늘 {구} 날씨`(10/21엔 0): 성동 6·부평 7·강남 7·구로 10·마포 10·송파 10·연수 11 | 16 이상 (10/21 10) | 새 색인: 서울 종로·중구·용산, /sky·/week·/season. 경기 등 구 39개 여전히 0, `내일 날씨` 꼴 0 |
|
||||
| 10/24 | 구글 | 구 39개 `{구} 오늘 날씨`(1~2p) + 날씨각 + 내일 4개 | 39개 중 34개 나옴(10/23 24개 중 21개). **만세 1p6** (구 페이지 첫 1페이지). 청원·효행 2p1. 날씨각 3 `/today/gyeonggi/seongnam`(10/23 2). 성동구 내일 2p3 `/tomorrow/seoul/seongdong`, 분당구 내일 2p6(오늘 페이지). 군산 내일 1~5p 없음(로그인) / 시크릿 4p, 군산 오늘 시크릿 3p(사용자 확인) | 약 383 (10/23 347) | 없음 5개: 처인·기흥·동탄·포항남·포항북 |
|
||||
| 10/24 | 네이버 | 10/23과 같은 168개 + 내일 4개 | 날씨각 1, 날씨각 성남 1, **성남 오늘 날씨 10 (새로 나옴)**. `{구} 오늘 날씨`: 강남 5·성동 6·구로 6·마포 6·연수 7·송파 7·부평 11. `오늘 {구} 날씨`: 성동 5·강남 6·송파 7·마포 9·연수 10·구로 12·부평 14 | site: 첫 화면 15 (10/23 16, 같은 수준) | 구 39개 0, `내일 날씨` 꼴 0(성동구·군산 포함). 부평은 뉴스 칸 영향으로 ±5 흔들림 |
|
||||
| 10/26 | 구글 | 10/24와 같은 범위(구 39개 1~2p + 날씨각 + 내일 3개·군산 오늘) | **날씨각 1** `/`(10/24 3). 39개 중 35개 나옴(10/24 34). **청원 1p6**, 만세 1p6→2p1, 효행 2p1, 처인 2p2(새로). 성동구 내일 2p4 `/tomorrow/seoul/seongdong`(10/24 2p3), 분당구 내일 2p7(오늘 페이지). 군산 내일 1~4p 없음, 군산 오늘 3p4 `/today/jeonbuk/gunsan`(로그인 첫 확인) | 약 421 (10/24 383) | 없음 4개: 기흥·동탄·포항남·포항북. 막힘(sorry) 없음 |
|
||||
| 10/26 | 네이버 | 10/24와 같은 172개 | 날씨각 1, 날씨각 성남 1, 성남 오늘 날씨 11(10/24 10). `{구} 오늘 날씨`: 연수 6·구로 6·마포 6·성동 6·송파 6·강남 8·부평 9. `오늘 {구} 날씨`: 송파 6·연수 8·성동 8·강남 9·마포 9·구로 10·부평 15. **송파구 내일 날씨 14 (새로 나옴, 오늘 페이지)** | site: 첫 화면 16 (10/24 15, 성남 추가) | 구 39개 0, 나머지 `내일 날씨` 꼴 0 |
|
||||
|
||||
|
||||
## 구글 구 39개 표
|
||||
|
||||
`2p6` = 2페이지 6번째 사이트. `내일` = 내일 페이지(`/tomorrow/`)가 나옴, `시` = 구 대신 시 페이지. `-` = 2페이지 안에 없음, 빈칸 = 안 봄.
|
||||
|
||||
| 구 | 10/21 `오늘 {구} 날씨` | 10/23 `오늘 {구} 날씨` | 10/23 `{구} 오늘 날씨` | 10/24 `{구} 오늘 날씨` | 10/26 `{구} 오늘 날씨` |
|
||||
|---|---|---|---|---|---|
|
||||
| 수원 장안 | 2p | | 2p6 | 2p7 내일 | 2p7 |
|
||||
| 수원 권선 | 2p | | 2p7 | 2p8 | 2p7 |
|
||||
| 수원 팔달 | 2p | | 2p6 내일 | 2p5 | 2p6 |
|
||||
| 수원 영통 | 2p | | 2p5 내일 | 2p6 | 2p6 |
|
||||
| 성남 수정 | 2p | | 2p7 시 | 2p2 | 2p3 |
|
||||
| 성남 중원 | 2p 시 | | 2p6 시 | 2p7 시 | 2p6 시 |
|
||||
| 성남 분당 | - | 2p6 | 2p4 | 2p3 | 2p5 |
|
||||
| 안양 만안 | 2p | | 2p5 | 2p6 | 2p4 |
|
||||
| 안양 동안 | 2p | | 2p6 내일 | 2p5 내일 | 2p5 내일 |
|
||||
| 부천 원미 | 2p | | 2p6 | 2p6 | 2p4 |
|
||||
| 부천 소사 | 2p | | 2p5 | 2p4 | 2p4 |
|
||||
| 부천 오정 | - | 2p4 | 2p2 내일 | 2p3 내일 | 2p5 |
|
||||
| 안산 상록 | - | 2p6 | 2p6 | 2p8 | 2p8 |
|
||||
| 안산 단원 | - | 2p4 | - | 2p8 | 2p9 |
|
||||
| 고양 덕양 | 2p | | 2p6 | 2p5 내일 | 2p5 내일 |
|
||||
| 고양 일산동 | 2p | | 2p5 | 2p6 내일 | 2p5 |
|
||||
| 고양 일산서 | 2p | | - | 2p6 | 2p6 |
|
||||
| 용인 처인 | - | - | 2p8 | - | 2p2 |
|
||||
| 용인 기흥 | - | 2p8 내일 | - | - | - |
|
||||
| 용인 수지 | 2p | | 2p7 | 2p7 | 2p8 |
|
||||
| 화성 만세 | 2p 시 | | 2p3 | **1p6** | 2p1 |
|
||||
| 화성 효행 | **1p** | | 2p1 내일 | 2p1 | 2p1 |
|
||||
| 화성 병점 | 2p | | 2p4 | 2p5 | 2p5 |
|
||||
| 화성 동탄 | 2p | | 2p7 내일 | - | - |
|
||||
| 청주 상당 | 2p | | | 2p7 | 2p7 |
|
||||
| 청주 서원 | 2p | | | 2p6 | 2p5 |
|
||||
| 청주 흥덕 | 2p | | | 2p5 | 2p4 |
|
||||
| 청주 청원 | 2p | | | 2p1 | **1p6** |
|
||||
| 천안 동남 | - | 2p7 | | 2p5 | 2p3 |
|
||||
| 천안 서북 | 2p | | | 2p4 | 2p5 |
|
||||
| 포항 남 | - | - | | - | - |
|
||||
| 포항 북 | - | - | | - | - |
|
||||
| 창원 의창 | 2p | | | 2p6 | 2p6 |
|
||||
| 창원 성산 | 2p | | | 2p5 | 2p5 |
|
||||
| 창원 마산합포 | - | 2p5 | | 2p6 | 2p6 |
|
||||
| 창원 마산회원 | - | - | | 2p4 | 2p5 |
|
||||
| 창원 진해 | - | - | | 2p6 내일 | 2p6 내일 |
|
||||
| 전주 완산 | 2p | | | 2p5 | 2p6 |
|
||||
| 전주 덕진 | 2p | | | 2p6 | 2p5 |
|
||||
## 메모
|
||||
|
||||
- 네이버는 `{구} 오늘 날씨` 꼴에서만 나온다. 같은 구라도 `{구} 날씨`·`오늘 {구} 날씨`는 안 나온다.
|
||||
- 네이버는 색인된 9곳 밖 지역이 나올 수 없다. 성남·수원은 색인돼 있어도 안 나온다.
|
||||
- 구글은 브라우저 fetch로 30여 개 치면 막힌다(결과 대신 확인 화면 → 보안문자). 하루 30개 안쪽으로 나눠 치거나 서치 콘솔 실적 보고서로 본다.
|
||||
- 10/21 구글 '오늘 분당구 날씨' **2페이지**에 `/today/gyeonggi/seongnam/bundang`(제목 '분당구 오늘 날씨, 뭐 할까? · 성남시') 나옴. 사용자 화면 2번째, 내 화면 9번째. 10/20 배포한 구 주소가 하루 만에 잡힘. 첫 페이지만 보는 테스트로는 놓친다 → 2페이지까지 본다.
|
||||
- 10/21 떨어진 것 확인: 우리 페이지(제목·설명·canonical)는 그대로, 네이버 색인 10개도 그대로(성동·부평 포함). 부평구 오늘 6→14는 위에 뉴스 4곳(newsinside·wikitree·YTN·KBS)이 새로 들어옴(비 오는 날). 성동구 오늘은 결과 사이트가 9곳뿐인 판에서 빠짐, 1~9위는 기상청·웨더아이·weather.com·accuweather 등. 구글 날씨각 2→4는 위 사이트를 저장 안 해서 원인 못 봄 → 다음부터 상위 사이트도 저장.
|
||||
- 10/21 같은 날 1시간 안에 다시 쳤더니 성동구 오늘 -→6, 부평구 오늘 14→9, 강남구 4→5, 송파 8→7. 네이버는 요청마다 뉴스 칸 등 구성이 바뀌어 ±5 안팎 변동은 잡음. 하루 비교로 오르내림 판단 금지, 3일 이상 같은 방향일 때만 원인 분석.
|
||||
- 10/21 서치 콘솔 URL 검사: 구 주소 39개 모두 "URL이 Google에 등록되어 있음" → 구글은 색인 문제가 아니라 순위 문제. 색인 생성 요청 안 함.
|
||||
- 상위 사이트 목록: `docs/search_log/날짜_naver_top.tsv` (10/21, 10/23, 10/24, 10/26) (검색어 → 1~15위 호스트). 다음 날 이 파일과 비교해 누가 새로 위에 들어왔는지 본다.
|
||||
- 10/20 구글 '분당구 오늘 날씨' 1~8위는 모두 제목에 '분당구'가 있는 구 단위 페이지.
|
||||
- 10/23 서치 콘솔 URL 검사: 내일 페이지 13곳(송파·남양주·평택·강서·강남·달서·김해·시흥·파주·광진·부산진·완도·진해) 모두 "URL이 Google에 등록되어 있음" → 구글은 사이트맵으로 내일 페이지를 이미 가져감, 색인 요청 안 함. 네이버 서치어드바이저는 Claude in Chrome에서 막혀 사람이 넣어야 함(순서: `docs/search_log/색인요청_인구순.txt`).
|
||||
- 10/24 `군산 내일 날씨`: 구글 1~5페이지 없음, 네이버 통합·웹 1~3페이지 없음. 구글 `site:weather.o2o.kr 군산`엔 /faq/jeonbuk·/faq만 나오고 군산 오늘·내일 페이지는 안 나옴.
|
||||
- 10/26 성동구 내일 vs 군산 내일: 두 페이지 제목 형식·canonical·사이트맵 같음. 구글 `site:` 로 둘 다 색인 확인(10/24 사용자 계정에서도 군산 내일 색인·2p 확인. site: 결과는 색인 전체를 보여주지 않아 색인 판단에 쓰지 않음). 구글 결과 수 군산 내일 약 304,000 vs 성동구 내일 약 74,800. 성동구 내일은 2p4, 군산 내일은 2p 안 1p·2p 모두 기상청·아큐웨더·웨더아이·meteocast 등. 네이버 군산 쪽 상위엔 군산시청·뉴스(economytalk·topstarnews·jbsori) 추가.
|
||||
@@ -1,39 +0,0 @@
|
||||
# 검색어 인기 리서치
|
||||
|
||||
조사일: 2026-10-20
|
||||
방법: 구글 트렌드(한국, 최근 12개월 평균, '세차'=100 기준 상대값), 구글·네이버 자동완성.
|
||||
한계: 구글 트렌드는 표본 값이라 같은 검색어도 묶음마다 수치가 2배까지 달라졌다(이번주 날씨 32·69). 자릿수로만 본다. 한국은 네이버 비중이 커서 네이버 실제 검색량(네이버 검색광고 키워드 도구, 광고 계정 필요)으로 다시 확인해야 한다.
|
||||
|
||||
## 구글 트렌드 상대 검색량 ('세차'=100)
|
||||
|
||||
| 묶음 | 검색어 = 값 |
|
||||
|---|---|
|
||||
| 날씨 일반 | 내일 날씨 ≈ 10,000 · 오늘 날씨 384 · 서울 날씨 295 · 이번주 날씨 32~69 · 주말 날씨 15 |
|
||||
| 지역 | 인천 날씨 80 · 수원 날씨 31 · 성남 날씨 7 · 강남 날씨 4 · 분당 날씨 2 · 마포구 날씨 0 · 판교 날씨 0 |
|
||||
| 생활 | 우산 181 · 빨래 160 · 미세먼지 156 · 노을 82 · 옷차림 82 · 일몰 시간 50 |
|
||||
| 활동+날씨 | 캠핑 날씨 1 · 러닝 날씨 1 · 날씨 좋은 날 1 · 세차 날씨 0 · 빨래 날씨 0 |
|
||||
|
||||
- '날씨'·'오늘 날씨'를 같은 묶음에 넣으면 나머지가 모두 0으로 반올림됐다. '날씨' 단독 검색이 압도적으로 많다.
|
||||
|
||||
## 자동완성 (사람들이 실제로 붙여 치는 말)
|
||||
|
||||
- 오늘 날씨: 구글 — 판교·성남·서울 / 네이버 — 서울·부산·인천·대전·대구, **오늘 날씨 옷차림**
|
||||
- 분당 날씨: 내일 분당 날씨, 오늘 분당 날씨, 이번주 분당 날씨, 현재 분당 날씨, 분당 날씨 비·강수량
|
||||
- 주말 날씨: 네이버 — **이번주말 날씨**, 서울·대구·대전·제주 주말 날씨, 다음주 주말 날씨
|
||||
- 날씨 좋은 날: 갈만한 곳, 카페, 산책, 드라이브, 데이트
|
||||
- 러닝 날씨: 복장, 옷 / 캠핑 날씨: 어플, 10월·11월 캠핑 날씨
|
||||
- 노을: 네이버 — 노을 지는 시간
|
||||
- 세차·빨래: 세차장·세차용품, 빨래방·건조대·쉰내 — 날씨와 붙여 치는 말은 자동완성에 없음
|
||||
|
||||
## 판단
|
||||
|
||||
- 사람이 많이 치는 꼴은 "지역 + 날씨"와 "내일/오늘/이번주(말) 날씨"다. 우리 지역 주소가 받아야 할 검색어가 이쪽이다.
|
||||
- 지역은 큰 시가 많다(인천·수원 > 성남 > 분당·강남). 구 단위('마포구 날씨', '판교 날씨')는 구글에서 거의 0이라, 구 주소는 "시 주소가 못 받는 동네 검색" 보조로 본다.
|
||||
- '세차각'·'세차 날씨'·'빨래 날씨'처럼 활동+날씨 검색은 거의 없다. 각 이름으로 검색 유입을 기대하긴 어렵고, 검색은 지역 날씨로 들어오게 하고 각은 들어온 뒤 차별점으로 쓰는 게 맞다.
|
||||
- 시간 표현은 '내일'이 '오늘'보다 훨씬 많다. 우리 지역 페이지는 제목이 "오늘 날씨"뿐이라 '내일 OO 날씨'를 받을 내용이 없다 → 내일 예보·내일 각을 페이지에 넣을지 기획 결정 필요.
|
||||
- '옷차림'(오늘 날씨 옷차림)·'우산'·'미세먼지'·'노을 지는 시간'은 날씨각이 이미 다루는 주제와 맞닿고 검색량이 세차보다 많다. 후보로 둔다.
|
||||
|
||||
## 다음에 확인할 것
|
||||
|
||||
- 네이버 검색광고 키워드 도구로 위 검색어의 네이버 월간 검색 수(PC·모바일) 확인 — https://searchad.naver.com
|
||||
- 네이버 데이터랩 검색어 트렌드로 계절 변화 확인 — https://datalab.naver.com/keyword/trendSearch.naver
|
||||
@@ -1,186 +0,0 @@
|
||||
# 구글 검색 정책 리서치
|
||||
|
||||
조사일: 2026-10-19 (사이트 이름, 방문자 수·광고와 순위는 2026-10-20 추가)
|
||||
원칙: 공식 문서에 적힌 것만 쓴다. 문장 끝 `[번호]`는 맨 아래 출처 번호다. 문서에 없는 건 "문서에 없음"으로 따로 적었다.
|
||||
|
||||
## 0. 채널별로 어떤 규칙을 따르나
|
||||
|
||||
날씨각은 채널마다 사용자가 찾아오는 곳과 순위를 정하는 주체가 다르다. 이 문서의 1~5장(구글 검색 정책)은 **웹** 칸에만 해당한다.
|
||||
|
||||
| 채널 | 사용자가 찾는 곳 | 순위·노출을 정하는 것 (공식 문서) | 구글 검색 정책 적용 |
|
||||
|---|---|---|---|
|
||||
| 웹 (weather.o2o.kr, 지역 페이지 `/today/…`) | 구글 검색 | 의미·관련성·품질·사용성·맥락(위치) [2]. 링크와 sitemap으로 페이지를 찾는다 [1] | 적용 (1~5장) |
|
||||
| 안드로이드 앱 · Wear OS 워치 앱/워치 페이스 (`watch/`) | Google Play 검색 | 평점·리뷰·다운로드 수 등 여러 요인이 함께 작용한다. 비중은 공개하지 않는다 [8] | 앱 안의 화면은 웹이 아니다. 앱 화면이 **내가 가진 웹페이지와 대응하고** Android App Links(딥링크 + 웹사이트 소유 확인)를 설정하면, 구글 검색 결과에서 앱으로 바로 열 수 있다 [9] |
|
||||
| 토스 인앱 (앱인토스 미니앱) | 토스 앱 안 검색, 공유 링크, 미니앱 스토어·전체탭 | 출시 → 추천 → 부스팅 3단계. 추천은 UX·실사용 지표(재방문율·전환율)·리뷰·성능 네 가지를 모두 충족해야 하고, 검색 결과에서 우선 노출된다 [10] | 미니앱이 구글 검색에 색인되는지는 **문서에 없음** [10][11] |
|
||||
| 알림 (앱 푸시 등) | 검색으로 찾는 대상이 아님 | — | 구글 검색은 웹페이지를 크롤링·색인한다 [1]. 알림 정책은 각 앱 플랫폼(Play, 토스) 문서를 따로 봐야 하며, 이 문서에서는 조사하지 않았다 |
|
||||
|
||||
- 앱인토스 노출 정책 시행일은 "10월 22일"로만 적혀 있고 연도는 없다. [10]
|
||||
- 토스 미니앱 검색 키워드가 순위를 어떻게 정하는지는 문서에 없다. 추천 미니앱이 "검색 결과에서 우선 노출"된다는 문장만 있다. [10]
|
||||
- 구글 Play 문서는 제목을 고유하고 앱 내용을 분명히 보여 주게 쓰라고 권하지만, 제목이 순위 요인이라고 적지는 않았다. [8]
|
||||
|
||||
## 1. 구글 검색이 동작하는 단계
|
||||
|
||||
- 구글은 크롤링 → 색인 → 검색 결과 제공의 세 단계로 동작한다. [1]
|
||||
- 크롤링: Googlebot이 페이지를 찾아 내려받는다. 찾은 페이지를 모두 크롤링하지는 않는다. [1]
|
||||
- 색인: 페이지 내용을 분석하고, 거의 같은 페이지는 묶어서 대표 페이지(canonical)를 정한다. 색인된다는 보장은 없다. [1]
|
||||
- 검색 결과 제공: 색인에서 가장 관련 있고 품질 높다고 판단한 페이지를 보여 준다. [1]
|
||||
- 구글은 페이지를 두 가지 방법으로 찾는다. 이미 아는 페이지의 **링크**를 따라가거나, 사이트 주인이 낸 **sitemap**을 읽는다. [1]
|
||||
- 돈을 받고 더 자주 크롤링하거나 순위를 올려 주지 않는다. 순위는 프로그램이 정한다. [1]
|
||||
|
||||
## 2. 순위를 정할 때 보는 신호
|
||||
|
||||
검색어에 따라 각 신호의 비중이 달라진다. [2]
|
||||
|
||||
| 신호 | 내용 |
|
||||
|---|---|
|
||||
| 의미 | 검색어의 의도를 파악한다. 오타 교정, 비슷한 말 처리 포함 [2] |
|
||||
| 관련성 | 페이지의 제목·본문이 검색어와 맞는지 본다 [2] |
|
||||
| 품질 | 전문성·권위·신뢰를 본다. 다른 유명 사이트가 링크를 거는지가 예시로 나온다 [2] |
|
||||
| 사용성 | 다른 조건이 비슷하면 모바일에서 잘 보이고 빠른 페이지가 유리할 수 있다 [2] |
|
||||
| 맥락 | 위치, 언어, 검색 기록, 설정으로 결과를 맞춘다 [2] |
|
||||
|
||||
### 위치
|
||||
|
||||
- 구글은 사용자 위치 같은 정보로 무엇이 가장 관련 있는지 정한다. [2]
|
||||
- 많은 검색어에 지역 의도가 있음을 알아본다. 예: '피자'를 치면 근처 배달 가게, 런던에서 'football'을 치면 축구 결과. [2]
|
||||
- 같은 검색어도 사용자 위치·언어·기기에 따라 결과가 다르다. 예: '자전거 수리점'은 파리와 홍콩에서 결과가 다르다. [1]
|
||||
|
||||
### 날씨
|
||||
|
||||
- **한국과 일본에서는 구글 날씨 예보를 제공하지 않는다.** [6]
|
||||
- 다른 나라에서 구글 날씨 예보는 각국 기상기관(NOAA, ECMWF, Met Office 등)의 모델과 관측을 쓰는 구글 자체 예보 시스템으로 만든다. [6]
|
||||
|
||||
### 광고비를 내면 순위가 오르나 → 아니다
|
||||
|
||||
- "검색 결과는 검색어만으로 정해지고, 기업·개인·단체가 광고를 사는지에 영향받지 않는다." [2]
|
||||
- "검색 알고리즘이 순위를 매길 때 광고주를 특별 대우하지 않으며, 누구도 그렇게 해 달라고 돈을 낼 수 없다." [2]
|
||||
- 검색 목록에 넣어 주는 데 돈을 받지 않는다. 광고나 관계없는 사업 제휴 같은 개인적·금전적 관계로 순위를 올려 주지 않는다. [13]
|
||||
- "구글 검색 결과는 구글 광고 프로그램과 독립돼 있다." [14]
|
||||
- 정리: 구글 광고(Google Ads)를 하면 광고 칸에 따로 뜰 뿐, 그 아래 일반 검색 결과 순위는 오르지 않는다.
|
||||
|
||||
### 방문자가 많으면 순위가 오르나 → 문서에 그런 말은 없다
|
||||
|
||||
- 사이트 방문자 수(트래픽)를 순위 신호로 쓴다는 문장은 공식 문서에 없다.
|
||||
- 문서에 있는 것: "검색 결과가 검색어와 관련 있는지 평가하려고, 모아서 익명 처리한 상호작용 데이터를 쓴다." [2] 검색 결과에서 사람들이 어떻게 반응하는지를 관련성 평가에 쓴다는 말이고, 방문자 수를 그대로 순위에 쓴다는 말은 아니다.
|
||||
- 인기와 가까운 신호로 문서에 나오는 것은 링크다: 품질을 볼 때 "다른 유명 사이트가 그 콘텐츠를 링크하거나 언급하는지"를 본다. [2] 링크로 페이지가 무엇에 대한 것인지·얼마나 도움이 되는지 판단한다. [3]
|
||||
|
||||
### 그럼 상위에 오르는 건 무엇으로 정해지나 (문서 기준)
|
||||
|
||||
- 검색어 의도에 맞는지(의미), 제목·본문에 검색어와 같은 말이 있는지(관련성), 도움이 되는 내용인지·다른 사이트가 링크·언급하는지(품질), 보기 쉬운지(사용성), 검색한 사람 위치·언어(맥락). 검색어마다 비중이 다르다. [2]
|
||||
- 검색 결과 다른 페이지들과 비교해 충분한 가치를 주는지, 자기만의 정보가 있는지를 스스로 점검하라고 한다. [15]
|
||||
- 판단(우리에게 적용): '분당구 오늘 날씨'는 제목·본문에 '분당구'가 있는 구 주소가 있어야 관련성에서 경쟁할 수 있다(10/20 구 주소 39장 배포). 그다음은 각 점수처럼 다른 날씨 사이트에 없는 정보, 그리고 다른 사이트의 링크·언급이다. 광고비나 방문자 수로 올리는 길은 문서상 없다.
|
||||
|
||||
## 3. 구글이 공개한 순위 시스템
|
||||
|
||||
[3]에 나온 것 중 우리와 관련 있는 것만 적었다.
|
||||
|
||||
| 시스템 | 내용 |
|
||||
|---|---|
|
||||
| BERT, RankBrain, Neural matching | 검색어와 페이지의 뜻을 이해한다. 검색어 단어가 그대로 없어도 관련 페이지를 찾는다 [3] |
|
||||
| Passage ranking | 페이지의 개별 구간도 따로 평가한다 [3] |
|
||||
| Freshness | 최신 내용이 필요한 검색어에는 새 내용을 보여 준다 [3] |
|
||||
| Link analysis, PageRank | 페이지끼리의 링크로 무엇에 대한 페이지인지, 얼마나 도움이 되는지 판단한다 [3] |
|
||||
| Exact match domain | 검색어와 똑같이 만든 도메인에 주는 점수를 제한한다 [3] |
|
||||
| Reliable information | 권위 있는 페이지를 올리고 품질 낮은 내용을 내린다 [3] |
|
||||
| Original content | 원본 내용을 인용만 한 페이지보다 우선한다 [3] |
|
||||
| Site diversity | 상위 결과에 같은 사이트는 보통 2개까지만 보여 준다 [3] |
|
||||
| Deduplication | 매우 비슷한 페이지가 많으면 가장 관련 있는 것만 보여 준다 [3] |
|
||||
| Spam detection (SpamBrain) | 스팸을 찾는다. 정기적으로 업데이트된다 [3] |
|
||||
| Helpful content | 2024년 3월부터 핵심 순위 시스템에 포함됐다 [3] |
|
||||
|
||||
## 4. 스팸 정책 (우리와 관련 있는 것)
|
||||
|
||||
### 관문 페이지 (Doorway abuse)
|
||||
|
||||
- 정의: 비슷한 특정 검색어로 순위를 얻으려고 만든 사이트나 페이지. [4]
|
||||
- 예시: 특정 지역이나 도시를 노린 도메인·페이지를 여러 개 만들어 한 페이지로 몰아가는 것. [4]
|
||||
|
||||
### 대량 생성 (Scaled content abuse)
|
||||
|
||||
- 정의: 주로 검색 순위를 조작하려고 많은 페이지를 만드는 것. [4]
|
||||
- 예시: 생성형 AI 같은 도구로 사용자에게 가치를 더하지 않는 페이지를 많이 만드는 것. [4]
|
||||
|
||||
### 숨긴 텍스트·링크 (Hidden text and link abuse)
|
||||
|
||||
- 정의: 검색엔진만을 위해 페이지에 내용을 넣는 것. [4]
|
||||
- 예시: 흰 배경에 흰 글씨, 이미지 뒤에 숨기기, CSS로 화면 밖에 두기, 글자 크기나 투명도를 0으로, 작은 글자 하나에만 링크 걸기. [4]
|
||||
- 위반이 아닌 것: 탭·아코디언처럼 눌러서 펼치는 내용, 슬라이드, 마우스를 올리면 나오는 툴팁, 스크린리더 전용 텍스트. [4]
|
||||
- 고치는 방법: URL 검사 도구로 구글에는 보이고 사람에게는 안 보이는 내용을 찾아, 사람과 크롤러가 똑같이 볼 수 있게 지우거나 스타일을 바꾼다. [5]
|
||||
|
||||
### 위반했을 때
|
||||
|
||||
- 정책을 위반한 사이트는 순위가 내려가거나 검색 결과에 아예 나오지 않을 수 있다. [4]
|
||||
- 구글은 자동 시스템과, 필요하면 사람 검토로 위반을 찾는다. 사람 검토는 수동 조치로 이어질 수 있다. [4]
|
||||
- 수동 조치: 구글 직원이 정책 위반이라고 판단해 내리는 조치다. [5]
|
||||
- 알림: 서치 콘솔의 "수동 조치" 보고서와 메시지 센터로 온다. [5]
|
||||
- 범위: 일부 페이지 또는 사이트 전체. [5]
|
||||
- 결과: 순위가 내려가거나 결과에서 빠진다. 사용자에게는 아무 표시가 없다. [5]
|
||||
- 일부 페이지만 고치면 일부만 복구되지 않는다. [5]
|
||||
- 복구: 해당 페이지를 모두 고친 뒤 "검토 요청"을 보낸다. 검토에 며칠에서 몇 주 걸린다. 검토 중에는 다시 보내지 않는다. [5]
|
||||
|
||||
## 5. 지도·지역 업체 순위 (참고)
|
||||
|
||||
웹페이지가 아니라 Google 비즈니스 프로필(지도의 가게 목록) 기준이다.
|
||||
|
||||
- 관련성: 프로필이 검색어와 얼마나 맞는지. [7]
|
||||
- 거리: 검색하는 사람과 업체 사이의 거리. 위치를 공유하지 않았으면 구글이 아는 위치 정보를 쓴다. [7]
|
||||
- 인지도: 얼마나 잘 알려졌는지. 다른 사이트의 링크, 리뷰 수와 평점이 포함된다. [7]
|
||||
|
||||
## 6. 사이트 이름 (검색 결과에 링크 위에 붙는 이름)
|
||||
|
||||
- 사이트 이름은 구글이 자동으로 정한다. 홈페이지 내용과 웹에서 그 사이트를 가리키는 언급을 함께 본다. [12]
|
||||
- 구글이 보는 곳: 홈의 `WebSite` 구조화 데이터, `og:site_name`, `<title>`, 제목 태그(h1 등) 등. [12]
|
||||
- 도메인(o2o.kr)과 서브도메인(weather.o2o.kr) 단위로 각각 정할 수 있다. 하위 경로(o2o.kr/weather) 단위는 안 된다. [12]
|
||||
- 서브도메인 홈에 구조화 데이터가 없으면, 상위 도메인의 사이트 이름을 대신 쓸 수 있다. [12]
|
||||
- `WebSite` 구조화 데이터는 홈에 있어야 한다. 필수는 `name`, `url`. `alternateName`은 선택이고 여러 개를 선호 순서대로 적을 수 있다. [12]
|
||||
- 구글은 자동으로 정한 이름을 사람이 직접 바꿔 주지 않는다. [12]
|
||||
- 원하는 이름이 안 나올 때 문서가 권하는 것: [12]
|
||||
- 구조화 데이터와 홈의 다른 이름 표기(제목, og 등)가 서로 맞는지 확인
|
||||
- 리디렉션, http·https 버전 모두 같은 이름인지 확인
|
||||
- 서치 콘솔에서 홈 재크롤링 요청. 반영까지 며칠에서 몇 주.
|
||||
- 그래도 안 되면 `alternateName`에 도메인 이름(소문자)을 넣어 대체 이름으로 둔다. 도메인 이름을 대표 이름으로 쓰는 건 마지막 수단.
|
||||
- 사이트 이름이 순위에 영향을 주는지는 문서에 없다. 문서에 적힌 목적은 "각 결과의 출처를 잘 나타내는 것"뿐이다. [12]
|
||||
|
||||
### 우리 상황 (2026-10-20 확인)
|
||||
|
||||
- 구글 '날씨각' 검색 결과에 weather.o2o.kr 사이트 이름이 '날씨각'이 아니라 '에이아이오투오'로 나온다.
|
||||
- weather.o2o.kr 홈: `WebSite` 구조화 데이터 `name` "날씨각", `alternateName` "날씨 각"·"Nalssigak", `og:site_name` "날씨각", `<title>` "날씨각 · …"으로 모두 같다.
|
||||
- o2o.kr 홈의 `<title>`은 "에이아이오투오"다.
|
||||
- 판단(문서에 없는 추정): 구글이 weather.o2o.kr의 이름을 아직 정하지 못해 상위 도메인 o2o.kr 이름을 쓰고 있을 가능성이 크다. 확인 방법은 서치 콘솔 URL 검사로 홈의 구조화 데이터가 인식됐는지 보는 것.
|
||||
- 판단: 순위 영향은 문서에 없다. 다만 '날씨각'을 검색한 사람에게 다른 이름이 보이면 우리 사이트인지 알아보기 어렵다. 할 일은 서치 콘솔에서 홈 재크롤링 요청 후 몇 주 지켜보는 것.
|
||||
|
||||
## 7. 공식 문서에 없는 것
|
||||
|
||||
- 앱(JS)이 뜨면서 화면에서 사라지는 첫 HTML 속 링크·텍스트가 숨긴 텍스트 위반인지는 문서에 없다. 위반 예시에도, 예외에도 없다.
|
||||
- '오늘 날씨' 같은 검색어에 구글이 사용자 위치를 어떻게 붙여 검색하는지 구체적인 방식은 문서에 없다. 문서에는 "위치를 쓴다", "지역 의도를 알아본다"까지만 있다. [2]
|
||||
- 새 페이지가 순위에 오르기까지 걸리는 기간은 문서에 없다.
|
||||
- 사이트 이름이 순위에 영향을 주는지는 문서에 없다. [12]
|
||||
- 사이트 방문자 수가 순위에 영향을 주는지는 문서에 없다. 있는 건 검색 결과에 대한 상호작용 데이터를 관련성 평가에 쓴다는 문장뿐이다. [2]
|
||||
|
||||
## 8. 직접 확인한 검색 결과 (2026-10-19, 구글, 한국어·한국 설정)
|
||||
|
||||
공식 문서가 아니라 한 번 직접 검색해 본 결과다. 사람·위치·시간마다 다를 수 있다.
|
||||
|
||||
- '날씨각': weather.o2o.kr 홈이 3위. 1위는 성남 AccuWeather(검색한 위치가 성남으로 잡힘), 2위는 기상청.
|
||||
- `site:weather.o2o.kr`: 홈, `/week`, `/gak`, `/season`과 지역 페이지 일부(광주 남구, 서울 중구, 동해, 이천, 완도, 영동)가 색인돼 있음.
|
||||
- '성남 날씨각', '완도 날씨각': 10위 안에 없음. 두 검색 모두 결과에 "누락된 검색어: 각"이 표시됨.
|
||||
- 2026-10-20 재확인: '날씨각' 3위 그대로, 사이트 이름은 '에이아이오투오'. '마포구 오늘 날씨'·'마포구 날씨'·'강남구 오늘 날씨'·'오늘 날씨'·'세차하기 좋은 날'·'오늘 노을 시간'은 20위 안에 없음.
|
||||
- 서버 로그(지난 7일): Googlebot이 지역 페이지 235개 중 39개를 가져감. sitemap은 2번 가져감.
|
||||
|
||||
## 출처
|
||||
|
||||
1. [How Google Search works — Google Search Central](https://developers.google.com/search/docs/fundamentals/how-search-works)
|
||||
2. [Ranking results — How Search Works](https://www.google.com/search/howsearchworks/how-search-works/ranking-results/)
|
||||
3. [A guide to Google Search ranking systems — Google Search Central](https://developers.google.com/search/docs/appearance/ranking-systems-guide)
|
||||
4. [Spam policies for Google web search — Google Search Central](https://developers.google.com/search/docs/essentials/spam-policies)
|
||||
5. [Manual actions report — Search Console 도움말](https://support.google.com/webmasters/answer/9044175)
|
||||
6. [Forecast information on Google Weather — Google 검색 도움말](https://support.google.com/websearch/answer/13687874)
|
||||
7. [How Google determines local ranking — Google 비즈니스 프로필 도움말](https://support.google.com/business/answer/7091)
|
||||
8. [Google Play에서 앱 검색·발견 — Play Console 도움말](https://support.google.com/googleplay/android-developer/answer/4448378?hl=ko)
|
||||
9. [Enable app content for Google Search (App Links) — Android Developers](https://developer.android.com/training/app-indexing)
|
||||
10. [미니앱 노출 정책 — 앱인토스 개발자 문서](https://developers-apps-in-toss.toss.im/guide/exposure)
|
||||
11. [앱인토스란 — 앱인토스 개발자 문서](https://developers-apps-in-toss.toss.im/intro/overview.html)
|
||||
12. [Provide a site name to Google Search — Google Search Central](https://developers.google.com/search/docs/appearance/site-names) (2025-12-10 갱신)
|
||||
13. [Our approach to Search — How Search Works](https://www.google.com/search/howsearchworks/our-approach/)
|
||||
14. [How Google search results differ from ads — Google Ads 도움말](https://support.google.com/google-ads/answer/1722080)
|
||||
15. [Creating helpful, reliable, people-first content — Google Search Central](https://developers.google.com/search/docs/fundamentals/creating-helpful-content) (2026-10-05 갱신)
|
||||
@@ -1,272 +0,0 @@
|
||||
<title>날씨각 데이터 흐름</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+KR:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap">
|
||||
<style>
|
||||
/* 레이아웃: 위에서 아래로 "흐름 → 하루 시계 → 화면별 데이터 → 출처 표 → 주의" 한 줄기. 시간은 전부 고정폭 숫자. */
|
||||
:root{
|
||||
--bg:#f5f7f9; --panel:#ffffff; --fg:#17212b; --muted:#5d6b78; --line:#d9e0e6; --grid:#e9eef2;
|
||||
--kma:#2f6fd6; --air:#9a5e08; --om:#7a4fd0; --tour:#176f48; --kasi:#5f6b78; --job:#c8414b;
|
||||
--soft-kma:#e5eefc; --soft-db:#eef0f3; --soft-redis:#fdeceb;
|
||||
--sans:"IBM Plex Sans KR",-apple-system,"Apple SD Gothic Neo","Malgun Gothic",sans-serif;
|
||||
--mono:"IBM Plex Mono",ui-monospace,Menlo,monospace;
|
||||
}
|
||||
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
|
||||
--bg:#10161c; --panel:#18212a; --fg:#e4eaf0; --muted:#97a5b2; --line:#2c3844; --grid:#212c36;
|
||||
--kma:#6fa0f0; --air:#e6a447; --om:#a687ec; --tour:#4fc08b; --kasi:#9aa6b3; --job:#ef6f77;
|
||||
--soft-kma:#1c2a40; --soft-db:#212a33; --soft-redis:#3a2124; color-scheme:dark}}
|
||||
:root[data-theme="dark"]{
|
||||
--bg:#10161c; --panel:#18212a; --fg:#e4eaf0; --muted:#97a5b2; --line:#2c3844; --grid:#212c36;
|
||||
--kma:#6fa0f0; --air:#e6a447; --om:#a687ec; --tour:#4fc08b; --kasi:#9aa6b3; --job:#ef6f77;
|
||||
--soft-kma:#1c2a40; --soft-db:#212a33; --soft-redis:#3a2124; color-scheme:dark}
|
||||
*{box-sizing:border-box}
|
||||
body{background:var(--bg);color:var(--fg);font:15px/1.6 var(--sans);margin:0}
|
||||
.wrap{max-width:1080px;margin:0 auto;padding-inline:20px;padding-block:36px 64px;display:flex;flex-direction:column;gap:44px}
|
||||
h1{font-size:28px;margin:0 0 6px;text-wrap:balance}
|
||||
h2{font-size:19px;margin:0 0 4px;text-wrap:balance}
|
||||
.lead{color:var(--muted);margin:0;max-width:68ch}
|
||||
.sub{color:var(--muted);margin:0 0 16px;font-size:14px;max-width:72ch}
|
||||
.mono,time{font-family:var(--mono);font-variant-numeric:tabular-nums}
|
||||
section{min-width:0}
|
||||
|
||||
/* 원칙 4개 */
|
||||
.rules{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:20px}
|
||||
.rule{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:14px 16px}
|
||||
.rule b{display:block;font-size:15px;margin-bottom:2px}
|
||||
.rule span{color:var(--muted);font-size:13.5px}
|
||||
|
||||
/* 흐름 */
|
||||
.flow{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;align-items:stretch}
|
||||
.step{position:relative;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:12px 12px 14px;margin-right:22px;min-width:0}
|
||||
.step:last-child{margin-right:0}
|
||||
.step:not(:last-child)::after{content:"→";position:absolute;right:-19px;top:50%;transform:translateY(-50%);color:var(--muted);font-size:16px}
|
||||
.step .k{font-family:var(--mono);font-size:11.5px;color:var(--muted);letter-spacing:.04em}
|
||||
.step b{display:block;font-size:14.5px;margin:2px 0 4px}
|
||||
.step p{margin:0;font-size:13px;color:var(--muted)}
|
||||
.step.redis{background:var(--soft-redis)}
|
||||
.step.db{background:var(--soft-db)}
|
||||
.step.ext{background:var(--soft-kma)}
|
||||
.hit{margin-top:10px;font-size:13.5px;color:var(--muted)}
|
||||
.hit b{color:var(--fg)}
|
||||
@media (max-width:860px){
|
||||
.flow{grid-template-columns:1fr;gap:20px}
|
||||
.step{margin-right:0}
|
||||
.step:not(:last-child)::after{content:"↓";right:auto;left:50%;top:auto;bottom:-20px;transform:translateX(-50%)}
|
||||
}
|
||||
|
||||
/* 하루 시계 */
|
||||
.scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
|
||||
.clock{min-width:760px;padding:14px 16px 12px}
|
||||
.crow{display:grid;grid-template-columns:170px 1fr;align-items:center;min-height:34px;border-bottom:1px solid var(--grid)}
|
||||
.crow:last-child{border-bottom:0}
|
||||
.crow .lab{font-size:13px;line-height:1.3;padding-right:10px}
|
||||
.crow .lab small{display:block;color:var(--muted);font-size:11.5px}
|
||||
.track{position:relative;height:30px;background:repeating-linear-gradient(90deg,var(--grid) 0 1px,transparent 1px calc(100%/24))}
|
||||
.tick{position:absolute;top:8px;width:9px;height:14px;margin-left:-4px;border-radius:2px;background:var(--c)}
|
||||
.tick.thin{width:3px;margin-left:-1px;top:9px;height:12px;opacity:.85}
|
||||
.band{position:absolute;top:9px;height:12px;border-radius:3px;background:var(--c);opacity:.22;border:1px solid var(--c)}
|
||||
.bandlab{position:absolute;top:8px;font-size:11px;font-family:var(--mono);color:var(--c);padding-left:5px;white-space:nowrap}
|
||||
.axis{display:grid;grid-template-columns:170px 1fr;margin-top:4px}
|
||||
.axis .nums{position:relative;height:16px;font-family:var(--mono);font-size:11px;color:var(--muted)}
|
||||
.axis .nums span{position:absolute;transform:translateX(-50%)}
|
||||
.now{position:absolute;top:0;bottom:0;width:2px;background:var(--fg);opacity:.5}
|
||||
.legend{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:13px;color:var(--muted);margin-top:12px}
|
||||
.legend i{display:inline-block;width:10px;height:10px;border-radius:2px;background:var(--c);margin-right:6px;vertical-align:-1px}
|
||||
|
||||
.what{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:8px 24px;margin:16px 0 0;padding:0}
|
||||
.what div{display:grid;grid-template-columns:84px 1fr;gap:10px;font-size:13.5px;padding:6px 0;border-top:1px solid var(--line)}
|
||||
.what dt{font-weight:700;color:var(--c)}
|
||||
.what dd{margin:0;color:var(--muted);min-width:0}
|
||||
/* 매트릭스 */
|
||||
table{border-collapse:collapse;width:100%;font-size:13.5px}
|
||||
th,td{border-bottom:1px solid var(--line);padding:8px 10px;text-align:left;vertical-align:top}
|
||||
thead th{font-size:12px;color:var(--muted);font-weight:500;white-space:nowrap;background:var(--panel);position:sticky;top:0}
|
||||
tbody tr:last-child td{border-bottom:0}
|
||||
.mx{min-width:820px}
|
||||
.mx td.c{text-align:center}
|
||||
.dot{display:inline-block;width:11px;height:11px;border-radius:50%;background:var(--c)}
|
||||
.ep{font-family:var(--mono);font-size:12.5px;white-space:nowrap}
|
||||
.scr{color:var(--muted);font-size:12.5px}
|
||||
.src{min-width:900px}
|
||||
.src td:first-child{white-space:nowrap}
|
||||
.chip{display:inline-block;font-size:11.5px;padding:1px 7px;border-radius:999px;border:1px solid var(--c);color:var(--c);white-space:nowrap}
|
||||
code{font-family:var(--mono);font-size:12.5px;background:var(--soft-db);padding:1px 5px;border-radius:4px}
|
||||
|
||||
/* 주의 */
|
||||
.warns{display:grid;gap:10px}
|
||||
.warn{display:grid;grid-template-columns:76px 1fr;gap:12px;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:12px 14px}
|
||||
.warn .tag{font-size:12px;font-weight:700;color:var(--job)}
|
||||
.warn .tag.doc{color:var(--muted)}
|
||||
.warn p{margin:0;font-size:14px;min-width:0}
|
||||
.warn small{color:var(--muted);font-family:var(--mono);font-size:12px}
|
||||
.foot{color:var(--muted);font-size:12.5px}
|
||||
</style>
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<header>
|
||||
<h1>날씨각 데이터 흐름</h1>
|
||||
<p class="lead">날씨각 서버는 정해진 시각에 데이터를 긁어 오지 않습니다. <b>누군가 그 구를 열었을 때</b> 갖고 있는 값이 오래됐으면 그때 받아서 저장·계산하고, 다음 사람부터는 저장된 값을 같이 씁니다. 정해진 시각에 도는 작업은 새벽 3시 하나뿐입니다.</p>
|
||||
<div class="rules">
|
||||
<div class="rule"><b>볼 때 받는다</b><span>외부 API는 사용자가 화면을 열 때, 값이 오래됐을 때만 부릅니다.</span></div>
|
||||
<div class="rule"><b>받으면 바로 DB</b><span>우리 형식으로 바꿔 PostgreSQL에 저장합니다. 원본 응답은 버립니다.</span></div>
|
||||
<div class="rule"><b>계산도 저장</b><span>체감기온·각 점수·노을 점수는 계산한 뒤 DB에 남깁니다.</span></div>
|
||||
<div class="rule"><b>Redis는 지워져도 됨</b><span>완성된 피드와 "받았음" 표시만 둡니다. 비어도 DB로 다시 만듭니다.</span></div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section>
|
||||
<h2>피드 하나를 열면</h2>
|
||||
<p class="sub">예: 17:20에 마포구 피드를 엽니다. <span class="mono">GET /v1/feed?region=마포구</span></p>
|
||||
<div class="flow">
|
||||
<div class="step redis"><div class="k">1 · REDIS</div><b>완성본 있나?</b><p><code>feed:마포구</code>가 있으면 그대로 돌려주고 끝.</p></div>
|
||||
<div class="step db"><div class="k">2 · DB</div><b>재료가 최신인가?</b><p>17시 단기예보, 17시 미세먼지, 오늘 구름이 DB에 있나 확인.</p></div>
|
||||
<div class="step ext"><div class="k">3 · 외부 API</div><b>오래된 것만 받기</b><p>여러 API를 동시에 부르고, 잠금으로 같은 구는 1번만 호출.</p></div>
|
||||
<div class="step db"><div class="k">4 · DB</div><b>저장 + 계산</b><p>날씨 저장하며 체감기온 계산 → 각 점수·노을 점수 계산해 저장.</p></div>
|
||||
<div class="step"><div class="k">5 · 조립</div><b>피드 칸 채우기</b><p>오늘 공개된 칸에 마포구 숫자·문장을 넣음. 채울 게 없는 칸은 뺌.</p></div>
|
||||
<div class="step redis"><div class="k">6 · REDIS</div><b>완성본 보관</b><p>다음 단기예보 제공 시각까지, 최대 1시간. 재료가 빠졌으면 60초.</p></div>
|
||||
</div>
|
||||
<p class="hit"><b>대부분은 1번에서 끝납니다.</b> DB에 직전 값이 있으면 3번은 뒤에서 받고, 이번 응답은 직전 값으로 바로 나갑니다. 좋아요·댓글 수만은 캐시를 안 쓰고 매번 DB에서 읽습니다.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>하루 동안 언제 새 값을 받나</h2>
|
||||
<p class="sub">표시는 "이 시각부터 새 값을 받을 수 있다"는 뜻입니다. 실제 호출은 그 뒤 처음 그 구를 연 사람 때 한 번 일어납니다. 아무도 안 열면 호출하지 않습니다.</p>
|
||||
<div class="scroll"><div class="clock" id="clock"></div></div>
|
||||
<div class="legend">
|
||||
<span style="--c:var(--kma)"><i></i>기상청</span>
|
||||
<span style="--c:var(--air)"><i></i>에어코리아</span>
|
||||
<span style="--c:var(--om)"><i></i>Open-Meteo</span>
|
||||
<span style="--c:var(--tour)"><i></i>TourAPI</span>
|
||||
<span style="--c:var(--kasi)"><i></i>천문연</span>
|
||||
<span style="--c:var(--job)"><i></i>스케줄러 (정해진 시각에 실제로 돎)</span>
|
||||
</div>
|
||||
<dl class="what">
|
||||
<div style="--c:var(--kma)"><dt>단기예보</dt><dd>오늘~글피(4일) 시간별 기온·하늘 상태·비/눈 종류·강수확률·강수량·습도·풍속, 하루 최저·최고기온</dd></div>
|
||||
<div style="--c:var(--kma)"><dt>초단기예보</dt><dd>앞으로 6시간 시간별 비/눈 종류·강수량·기온</dd></div>
|
||||
<div style="--c:var(--kma)"><dt>중기예보</dt><dd>4~10일 뒤 오전·오후 날씨(맑음·구름·흐림·비)와 최저·최고기온</dd></div>
|
||||
<div style="--c:var(--kma)"><dt>기상특보</dt><dd>최근 7일 구역별 특보 종류(강풍·호우 등)와 단계</dd></div>
|
||||
<div style="--c:var(--air)"><dt>미세먼지</dt><dd>전국 측정소별 PM10·PM2.5 농도와 등급</dd></div>
|
||||
<div style="--c:var(--om)"><dt>층별 구름</dt><dd>3일치 낮은·중간·높은 구름 양(%), 해 지는·뜨는 쪽 20·100km 지점, 예보 모델 2개(일본 JMA·독일 ICON)</dd></div>
|
||||
<div style="--c:var(--tour)"><dt>축제·행사</dt><dd>행사 이름·장소·시작일·종료일</dd></div>
|
||||
<div style="--c:var(--kasi)"><dt>공휴일·절기</dt><dd>그해 공휴일과 24절기의 날짜·이름</dd></div>
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>어느 화면이 어떤 데이터를 부르나</h2>
|
||||
<p class="sub">● 표시는 그 API를 부르면 그 데이터가 오래됐는지 확인하고, 필요하면 외부에서 받는다는 뜻입니다. 메인 피드는 거의 전부를 건드립니다.</p>
|
||||
<div class="scroll"><table class="mx">
|
||||
<thead><tr><th>API</th><th>화면</th><th>단기예보</th><th>초단기</th><th>중기</th><th>미세먼지</th><th>특보</th><th>층별 구름</th><th>축제</th><th>공휴일</th><th>절기</th></tr></thead>
|
||||
<tbody id="mx"></tbody>
|
||||
</table></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>무엇을 어디서 받아 어디에 두나</h2>
|
||||
<p class="sub">공공데이터포털 API는 모두 <code>DATA_GO_KR_SERVICE_KEY</code> 하나로 부르고, 실패하면 3번까지 다시 시도합니다.</p>
|
||||
<div class="scroll"><table class="src">
|
||||
<thead><tr><th>데이터</th><th>출처</th><th>한 번에</th><th>새 값 기준</th><th>저장 (DB)</th><th>Redis</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>시간별·하루 날씨</td><td><span class="chip" style="--c:var(--kma)">기상청 단기예보</span></td><td>구 1곳</td><td>02·05·08·11·14·17·20·23시 <span class="mono">+10분</span></td><td><code>weather_hourly</code> <code>weather_daily</code></td><td>잠금만</td></tr>
|
||||
<tr><td>앞으로 몇 시간 비</td><td><span class="chip" style="--c:var(--kma)">기상청 초단기예보</span></td><td>구 1곳</td><td>매시 <span class="mono">:45</span></td><td>저장 안 함</td><td><code>ultra:{구}</code> 약 1시간</td></tr>
|
||||
<tr><td>4~10일 뒤 날씨</td><td><span class="chip" style="--c:var(--kma)">기상청 중기예보</span></td><td>예보 구역 1곳</td><td>06·18시 <span class="mono">+30분</span></td><td><code>weather_daily</code></td><td><code>mid:</code> 표시 13시간</td></tr>
|
||||
<tr><td>기상특보</td><td><span class="chip" style="--c:var(--kma)">기상청 특보</span></td><td>전국</td><td>매시 정각</td><td><code>weather_warning</code></td><td><code>warning:fetched</code> 1시간</td></tr>
|
||||
<tr><td>미세먼지</td><td><span class="chip" style="--c:var(--air)">에어코리아 실시간</span></td><td>전국</td><td>매시 <span class="mono">:20</span></td><td><code>air_quality</code></td><td><code>air:tried</code> 10분</td></tr>
|
||||
<tr><td>측정소 위치</td><td><span class="chip" style="--c:var(--air)">에어코리아 측정소</span></td><td>전국</td><td>처음 + 매일 03:00</td><td><code>air_station</code></td><td>—</td></tr>
|
||||
<tr><td>층별 구름 (노을·일출)</td><td><span class="chip" style="--c:var(--om)">Open-Meteo</span></td><td>좌표 24개씩</td><td>오전 · 13시 · 21시 시간대마다 1번</td><td><code>cloud_hourly</code></td><td><code>sky:</code> 표시 24시간</td></tr>
|
||||
<tr><td>자외선·가시거리·일조 등</td><td><span class="chip" style="--c:var(--om)">Open-Meteo</span></td><td>전국 256곳</td><td>6시간마다 03·09·15·21시 10분 (worker)</td><td><code>openmeteo_hourly</code></td><td>—</td></tr>
|
||||
<tr><td>축제·행사</td><td><span class="chip" style="--c:var(--tour)">TourAPI</span></td><td>시도 1곳</td><td>그 시도 하루 1번</td><td><code>event</code></td><td><code>event:</code> 표시 24시간</td></tr>
|
||||
<tr><td>공휴일 · 24절기</td><td><span class="chip" style="--c:var(--kasi)">천문연</span></td><td>1년치</td><td>그해 값이 없을 때</td><td><code>holiday</code> <code>solar_term</code></td><td>표시 30일</td></tr>
|
||||
<tr><td>해 뜨고 지는 시각</td><td><span class="chip" style="--c:var(--kasi)">서버 계산</span></td><td>구 1곳</td><td>그날 값이 없을 때</td><td><code>sun_time</code></td><td>—</td></tr>
|
||||
<tr><td>각 점수 × 3일</td><td><span class="chip" style="--c:var(--fg)">계산</span></td><td>구 1곳</td><td>예보·미세먼지가 점수보다 새로우면</td><td><code>index_score</code></td><td>—</td></tr>
|
||||
<tr><td>노을·일출 점수</td><td><span class="chip" style="--c:var(--fg)">계산</span></td><td>구 1곳</td><td>구름 받은 직후</td><td><code>sky_score</code></td><td>—</td></tr>
|
||||
<tr><td>그날 피드 칸·순서</td><td><span class="chip" style="--c:var(--job)">스케줄러</span></td><td>전국 공통</td><td>매일 03:00</td><td><code>post</code></td><td><code>feed:*</code> 전부 비움</td></tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>왜 이 출처를 쓰나</h2>
|
||||
<p class="sub">결론: 기온·비 같은 예보는 기상청에서 받고, 기상청에 없는 높이별 구름만 Open-Meteo에서 받습니다. 예보는 Open-Meteo 한 번 호출로도 받을 수 있지만, 아래 세 가지 이유로 기상청을 씁니다.</p>
|
||||
<div class="rules">
|
||||
<div class="rule"><b>1. 앱 안에서 숫자가 엇갈리지 않는다</b><span>폭염·한파·호우 특보는 Open-Meteo가 주지 않습니다. 그래서 특보는 기상청에서 받을 수밖에 없습니다. 그런데 기상청은 자기 예보를 보고 특보를 내립니다. 기온·비를 Open-Meteo에서 받으면, 같은 피드에 "폭염주의보"와 그보다 낮은 최고기온이 함께 나오는 식으로 서로 엇갈릴 수 있습니다. 그래서 예보도 특보와 같은 기상청에서 받습니다.</span></div>
|
||||
<div class="rule"><b>2. 비용과 약관</b><span>기상청 데이터는 공공데이터라 회사 서비스에 써도 무료입니다. Open-Meteo 무료판은 비상업용이고 하루 1만·월 30만 번까지만 부를 수 있어, 회사 서비스면 유료 플랜이 필요합니다.</span></div>
|
||||
<div class="rule"><b>3. 어차피 국내 API가 필요</b><span>특보, 측정소 실측 미세먼지, 공휴일·절기, 축제는 Open-Meteo에 없어서 어느 쪽을 골라도 공공데이터포털을 써야 합니다. 예보까지 같은 곳에서 받으면 키 하나로 관리됩니다.</span></div>
|
||||
</div>
|
||||
<p class="hit"><b>두 예보를 비교해 보니 (10/6, 전국 20개 구, 앞으로 48시간)</b>: 기온이 평균 1.3°, 많게는 3.6°(속초) 달랐고 습도는 9%p 달랐습니다. 우리 앱은 기온 기준으로 각 점수와 문구를 정합니다. 예를 들어 주말 예보는 아침 10° 이하면 "두꺼운 겉옷 필수", 낮 28° 이상이면 "물이랑 모자"라고 씁니다. 그래서 1~3° 차이면 사용자에게 보이는 내용이 바뀝니다. 즉 출처를 바꾸는 것은 가볍게 정할 일이 아닙니다.<br>
|
||||
다만 이 비교로는 두 예보가 다르다는 것만 알 수 있고, 어느 쪽이 실제 날씨에 더 맞는지는 알 수 없습니다. 그래서 기온 차이 자체는 기상청을 고른 이유가 아닙니다. 정확도는 비 오는 날을 포함해 3일간 두 예보를 모아 실측과 비교할 예정입니다(TODO).</p>
|
||||
|
||||
<h2 style="margin-top:22px">기상청 예보를 왜 API 3개로 받나</h2>
|
||||
<p class="sub">기상청에는 기간 전체를 한 번에 주는 API가 없고, 기간마다 따로 줍니다. 그래서 화면에 필요한 기간에 맞춰 나눠 부릅니다.</p>
|
||||
<div class="scroll"><table>
|
||||
<thead><tr><th>기상청 API</th><th>기간</th><th>단위</th><th>쓰는 곳</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>초단기예보</td><td>앞으로 6시간</td><td>1시간 · 구</td><td>"2시간 안에 비", 지금 날씨</td></tr>
|
||||
<tr><td>단기예보</td><td>오늘~글피 (4일)</td><td>1시간 · 구</td><td>오늘·내일 날씨, 각 점수, 출퇴근, 4일 안의 주말 플랜</td></tr>
|
||||
<tr><td>중기예보</td><td>4~10일 뒤</td><td>오전·오후 · 도</td><td>주간 날씨, 4일 넘게 남은 주말 예보·플랜</td></tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
|
||||
<h2 style="margin-top:22px">구름만 Open-Meteo인 이유</h2>
|
||||
<p class="sub">기상청 하늘 상태는 맑음·구름많음·흐림 3단계뿐입니다. 노을이 예쁜지는 구름 높이가 정합니다. 높은 구름은 노을빛을 받아 물들고, 낮은 구름은 해를 가립니다. 높이별 구름 양과 여러 나라 예보 모델의 비교를 무료로 받을 수 있는 곳이 Open-Meteo여서 이 부분만 씁니다. 회사 서비스면 이 부분도 유료 플랜이 필요합니다.</p>
|
||||
|
||||
<h2 style="margin-top:22px">이렇게 나눠서 감수하는 것</h2>
|
||||
<div class="warns">
|
||||
<div class="warn"><div class="tag doc">장애</div><p>외부 기관 5곳(기상청·에어코리아·Open-Meteo·TourAPI·천문연)에 기대므로 어느 한 곳이 멈추면 그 칸이 빠집니다. 기관이 멈추면 8초까지만 기다린 뒤 저장해 둔 값을 보여주고, 그 기관은 2분 동안 다시 부르지 않습니다. 그래서 멈춘 동안 기다리는 사람은 기관마다 2분에 한 명꼴입니다.</p></div>
|
||||
<div class="warn"><div class="tag doc">먼 날짜</div><p>4~10일 뒤는 중기예보라 도 단위·오전/오후로만 나옵니다. 그래서 주말까지 4일 넘게 남은 월·화요일에는 주말 플랜에 "15~19시 비" 같은 시간대를 넣을 수 없습니다. Open-Meteo는 이 기간도 1시간 단위로 주는데, 그걸 포기한 셈입니다.</p></div>
|
||||
<div class="warn"><div class="tag doc">유료 결정</div><p>노을 구름 때문에 출시 전에 Open-Meteo 유료 여부를 정해야 합니다.</p></div>
|
||||
</div>
|
||||
<p class="hit"><b>다시 볼 때</b>: 정확도 비교(TODO)에서 Open-Meteo가 뚜렷하게 더 맞는다고 나오면 다시 검토합니다. 그래도 1번 이유(특보와 엇갈림)는 남기 때문에 통일보다는 4~10일 뒤만 Open-Meteo로 받는 방식이 먼저 후보입니다.</p>
|
||||
</section>
|
||||
|
||||
<p class="foot">기준: backend 코드 (services/, scheduler/jobs.py, router/v1/), 2026-10-07.</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function(){
|
||||
var pct=function(h){return (h/24*100)+'%'};
|
||||
var rows=[
|
||||
{lab:'단기예보',sub:'구 1곳 · 발표 +10분',c:'--kma',ticks:[2,5,8,11,14,17,20,23].map(function(h){return h+10/60})},
|
||||
{lab:'초단기예보',sub:'구 1곳 · 매시 :45',c:'--kma',thin:true,ticks:Array.from({length:24},function(_,h){return h+45/60})},
|
||||
{lab:'중기예보',sub:'4~10일 뒤 · 06:30 · 18:30',c:'--kma',ticks:[6.5,18.5]},
|
||||
{lab:'기상특보',sub:'전국 · 매시 :00',c:'--kma',thin:true,ticks:Array.from({length:24},function(_,h){return h})},
|
||||
{lab:'미세먼지',sub:'전국 · 매시 :20',c:'--air',thin:true,ticks:Array.from({length:24},function(_,h){return h+20/60})},
|
||||
{lab:'층별 구름',sub:'시간대마다 1번',c:'--om',bands:[[0,13,'오전 → 오늘 노을'],[13,21,'13시 → 노을 갱신'],[21,24,'21시 → 내일 일출']]},
|
||||
{lab:'축제·행사',sub:'시도별 하루 1번',c:'--tour',bands:[[0,24,'그날 처음 볼 때 1번']]},
|
||||
{lab:'공휴일·절기',sub:'1년 1번',c:'--kasi',bands:[[0,24,'그해 값이 없을 때만']]},
|
||||
{lab:'스케줄러',sub:'worker · 03:00',c:'--job',ticks:[3],note:'03:00 피드 칸 정하기 · 오래된 행 삭제 · 측정소 갱신'}
|
||||
];
|
||||
var el=document.getElementById('clock');var html='';
|
||||
rows.forEach(function(r){
|
||||
var t='';
|
||||
(r.bands||[]).forEach(function(b){t+='<div class="band" style="left:'+pct(b[0])+';width:calc('+pct(b[1]-b[0])+' - 3px)"></div><div class="bandlab" style="left:'+pct(b[0])+'">'+b[2]+'</div>'});
|
||||
(r.ticks||[]).forEach(function(h){var hh=Math.floor(h),mm=Math.round((h-hh)*60);t+='<div class="tick'+(r.thin?' thin':'')+'" style="left:'+pct(h)+'" title="'+String(hh).padStart(2,'0')+':'+String(mm).padStart(2,'0')+'"></div>'});
|
||||
if(r.note)t+='<div class="bandlab" style="left:calc('+pct(3)+' + 8px)">'+r.note+'</div>';
|
||||
html+='<div class="crow" style="--c:var('+r.c+')"><div class="lab">'+r.lab+'<small>'+r.sub+'</small></div><div class="track">'+t+'<div class="now" id="now-'+rows.indexOf(r)+'"></div></div></div>';
|
||||
});
|
||||
var nums='';for(var h=0;h<=24;h+=3)nums+='<span style="left:'+pct(h)+'">'+String(h).padStart(2,'0')+'</span>';
|
||||
html+='<div class="axis"><div></div><div class="nums">'+nums+'</div></div>';
|
||||
el.innerHTML=html;
|
||||
var d=new Date(),n=d.getHours()+d.getMinutes()/60;
|
||||
document.querySelectorAll('.now').forEach(function(x){x.style.left=pct(n)});
|
||||
|
||||
var cols=['vil','ultra','mid','air','warn','sky','event','hol','solar'];
|
||||
var color={vil:'--kma',ultra:'--kma',mid:'--kma',air:'--air',warn:'--kma',sky:'--om',event:'--tour',hol:'--kasi',solar:'--kasi'};
|
||||
var eps=[
|
||||
['/v1/feed','메인 피드',['vil','ultra','mid','air','warn','sky','event','hol']],
|
||||
['/v1/feed/post/{id}','포스트 하나',['vil','ultra','mid','air','warn','sky','event','hol']],
|
||||
['/v1/weather/today','오늘 날씨',['vil']],
|
||||
['/v1/weather/now','지금 날씨',['vil','ultra','air','warn']],
|
||||
['/v1/sky','노을·일출',['sky']],
|
||||
['/v1/sky/ranking','노을 순위',['sky']],
|
||||
['/v1/index/list · {id}','각 목록·상세',['vil','air','warn']],
|
||||
['/v1/week','주말 계획',['vil','mid','hol']],
|
||||
['/v1/week/event/list','행사',['vil','mid','event']],
|
||||
['/v1/season/week','계절 책',['solar']],
|
||||
['article · region · reaction · auth','글·지역·좋아요·로그인',[]]
|
||||
];
|
||||
document.getElementById('mx').innerHTML=eps.map(function(e){
|
||||
return '<tr><td class="ep">'+e[0]+'</td><td class="scr">'+e[1]+'</td>'+cols.map(function(c){return '<td class="c">'+(e[2].indexOf(c)>-1?'<span class="dot" style="--c:var('+color[c]+')" aria-label="사용"></span>':'')+'</td>'}).join('')+'</tr>';
|
||||
}).join('');
|
||||
})();
|
||||
</script>
|
||||