| name | lotto-results |
| description | Check Korean Lotto draw results, latest rounds, and ticket matches with the k-lotto npm package. Use when the user asks for winning numbers, payout details, or whether their numbers matched. |
| license | MIT |
| metadata | {"category":"utility","locale":"ko-KR","phase":"v1"} |
Lotto Results
What this skill does
k-lotto ํจํค์ง๋ก ๋ํ๋ณต๊ถ ๋ก๋ ์ต์ ํ์ฐจ, ํน์ ํ์ฐจ, ์์ธ ๋น์ฒจ ๊ฒฐ๊ณผ, ๋ฒํธ ๋์กฐ๋ฅผ ์ฒ๋ฆฌํ๋ค.
When to use
- "์ด๋ฒ ์ฃผ ๋ก๋ ๋ฒํธ ๋ญ์ผ"
- "1210ํ ๋น์ฒจ๋ฒํธ ์๋ ค์ค"
- "๋ด ๋ฒํธ๊ฐ ๋ช ๋ฑ์ธ์ง ๋ด์ค"
Prerequisites
- Node.js 18+
- ๋ฐฐํฌ ํ:
npm install -g k-lotto
- ์คํ ์ :
export NODE_PATH="$(npm root -g)"
- ์ด ์ ์ฅ์์์ ๊ฐ๋ฐํ ๋: ๋ฃจํธ์์
npm install
Inputs
- ํ์ฐจ ๋ฒํธ ๋๋ "latest"
- ์ ํ ์ฌํญ: ์ฌ์ฉ์๊ฐ ๊ฐ์ง 6๊ฐ ๋ฒํธ
Workflow
0. Install the package globally when missing
node -e 'require("k-lotto")' ๊ฐ ์คํจํ๋ฉด ๋ค๋ฅธ ๊ตฌํ์ผ๋ก ์ฐํํ์ง ๋ง๊ณ ์ ์ญ Node ํจํค์ง ์ค์น๋ฅผ ๋จผ์ ์๋ํ๋ค.
npm install -g k-lotto
export NODE_PATH="$(npm root -g)"
ํจํค์ง๊ฐ ์๋ค๋ ์ด์ ๋ก HTML ํ์๋ฅผ ๋ค์ ์ง๊ฑฐ๋ ๋ค๋ฅธ ๋น๊ณต์ ์์ค๋ฅผ ์ฐพ์ง ์๋๋ค.
1. Get the latest round when needed
NODE_PATH="$(npm root -g)" node - <<'JS'
const lotto = require("k-lotto");
lotto.getLatestRound().then((round) => console.log(round));
JS
2. Fetch result or detailed payout data
NODE_PATH="$(npm root -g)" node - <<'JS'
const lotto = require("k-lotto");
lotto.getDetailResult(1216).then((result) => console.log(JSON.stringify(result, null, 2)));
JS
3. Check user's numbers when provided
NODE_PATH="$(npm root -g)" node - <<'JS'
const lotto = require("k-lotto");
lotto.checkNumber(1216, ["3", "10", "14", "15", "23", "24"])
.then((result) => console.log(JSON.stringify(result, null, 2)));
JS
Done when
- ์ต์ ๋๋ ์์ฒญ ํ์ฐจ์ ๋ฒํธ๊ฐ ํ์ธ๋์ด ์๋ค
- ์์ธ ์์ฒญ์ด๋ฉด ์ถ์ฒจ์ผ๊ณผ ๋น์ฒจ๊ธ ๋ถํฌ๊ฐ ์ ๋ฆฌ๋์ด ์๋ค
- ๋ฒํธ ๋์กฐ ์์ฒญ์ด๋ฉด ์ผ์น ๋ฒํธ์ ๋ฑ์๊ฐ ํ์ธ๋์ด ์๋ค
Failure modes
- ์ต์ ํ์ฐจ๋ ๊ฒฐ๊ณผ ํ์ด์ง HTML์์ ์ฝ๊ธฐ ๋๋ฌธ์ upstream HTML ๋ณ๊ฒฝ์ ์ํฅ์ ๋ฐ์ ์ ์๋ค
- ์์ธ ํ์ฐจ ์ ๋ณด๋ ๋ํ๋ณต๊ถ JSON ์๋ต ์คํค๋ง ๋ณ๊ฒฝ์ ์ํฅ์ ๋ฐ์ ์ ์๋ค
Notes
- ์ฌ์ฉ์ ๋ฒํธ๋ฅผ ๋ฐ์๋ ์๊ตฌ ์ ์ฅํ์ง ์๋๋ค
- ์กฐํ ์ ์ฉ ์คํฌ์ด๋ค