๋์ด์ค ํ์์๋น์ค ํ์ด์ง๋ฅผ ํ์ฑํ์ฌ JSON API๋ก ์ ๊ณตํ๋ ์๋น์ค์ ๋๋ค.
๋์ด์ค ๊ณต์ OpenAPI๋ฅผ ์ด์ฉํด์ฃผ์ธ์ https://open.neis.go.kr
https://api.chemistryx.me/neis
GET /meal/{schoolCode}/{schoolStage}/{year}/{month}
๋งค๊ฐ๋ณ์ | ์ค๋ช |
---|---|
schoolCode | ํ๊ต ์ฝ๋(10์๋ฆฌ) |
schoolStage | ํ๊ต ๊ณผ์ ์ฝ๋(1์๋ฆฌ) |
year | ์กฐํํ๊ณ ์ ํ๋ ์ฐ๋(4์๋ฆฌ) |
month | ์กฐํํ๊ณ ์ ํ๋ ๋ฌ(2์๋ฆฌ) |
{
"status": true,
"schoolCode": "X000000000",
"schoolStage": "0",
"year": "2020",
"month": "02",
"menu": [
{
"date": 1,
"breakfast": [],
"lunch": ["ํ๋ฏธ๋ฐฅ(๊ณ )", "์ ๊ณ ๊ธฐ๊ฐ์๊ตญ(๊ณ )", "ํฌํฌ์ปคํ๋ (๊ณ )", "๊ผฌ๋ง์์ก์ด๋ฒ์ฏ๋ณถ์", "์ผ์ฑ์ซ๋ฉด๋ฌด์นจ(๊ณ )", "๋ฐฐ์ถ๊น์น(๊ณ )", "๋์ฅ์์ค(๊ณ )", "ํค์"],
"dinner": []
}
]
}
GET /schedule/{schoolCode}/{schoolStage}/{year}/{month}
๋งค๊ฐ๋ณ์ | ์ค๋ช |
---|---|
schoolCode | ํ๊ต ์ฝ๋(10์๋ฆฌ) |
schoolStage | ํ๊ต ๊ณผ์ ์ฝ๋(1์๋ฆฌ) |
year | ์กฐํํ๊ณ ์ ํ๋ ์ฐ๋(4์๋ฆฌ) |
month | ์กฐํํ๊ณ ์ ํ๋ ๋ฌ(2์๋ฆฌ) |
{
"status": true,
"schoolCode": "X000000000",
"schoolStage": "0",
"year": "2020",
"month": "02",
"schedule": [
{
"date": 1,
"content": ["์ฌ๋ฆ๋ฐฉํ"]
}
]
}
์ฐธ๊ณ
Ruby 2.5์ด์์ด ์ค์น๋์ด ์์ด์ผ ํฉ๋๋ค.
bundle install
jets server
ํ๊ต ์ฝ๋๋ https://par.goe.go.kr/spr_ccm_cm01_100.do?kraOrgNm={ํ๊ต์ด๋ฆ} ์ ํตํด ๋์จ orgCode
๊ฐ์์ ์ฐพ์ ์ ์์ต๋๋ค.
ํ๊ต ๊ณผ์ ์ฝ๋๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
ํ๊ต | ํ๊ต ๊ณผ์ ์ฝ๋ |
---|---|
๊ณ ๋ฑํ๊ต | 4 |
์คํ๊ต | 3 |
์ด๋ฑํ๊ต | 2 |