From 1a15b765cb0e58908d609425c7b5358681bdeafc Mon Sep 17 00:00:00 2001 From: xnousnow Date: Sun, 7 May 2023 19:38:51 +0900 Subject: [PATCH 01/25] =?UTF-8?q?:sparkles:=20=EA=B8=89=EC=8B=9D=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=ED=8A=B9=EC=88=98=EB=AC=B8=EC=9E=90=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index c39b6d9..1aa304e 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -66,7 +66,7 @@ export async function getMeal(cityCode: string, schoolCode: number, date: string const json = await res.json() if (json.mealServiceDietInfo) { - meal = removeAllergyInfo(json.mealServiceDietInfo[1].row[0].DDISH_NM.split('
')) + meal = removeAllergyInfo(json.mealServiceDietInfo[1].row[0].replace(/[^가-힣()]+/g, '').DDISH_NM.split('
')) error = false errorCode = 0 } else { From f5a35938bba73b2ecaa2511332b29257c0f35910 Mon Sep 17 00:00:00 2001 From: xnousnow Date: Sun, 7 May 2023 19:41:27 +0900 Subject: [PATCH 02/25] =?UTF-8?q?:art:=20=EC=BD=94=EB=93=9C=20=ED=8F=AC?= =?UTF-8?q?=EB=A7=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index 1aa304e..f0a4501 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -54,7 +54,11 @@ export function removeAllergyInfo(meal: string[]) { return meal.map((menu) => menu.replace(/ +\([0-9. ]+\)/g, '')) } -export async function getMeal(cityCode: string, schoolCode: number, date: string): Promise { +export async function getMeal( + cityCode: string, + schoolCode: number, + date: string +): Promise { let meal: string[] = [] let error = false let errorCode = 0 @@ -66,7 +70,9 @@ export async function getMeal(cityCode: string, schoolCode: number, date: string const json = await res.json() if (json.mealServiceDietInfo) { - meal = removeAllergyInfo(json.mealServiceDietInfo[1].row[0].replace(/[^가-힣()]+/g, '').DDISH_NM.split('
')) + meal = removeAllergyInfo( + json.mealServiceDietInfo[1].row[0].replace(/[^가-힣()]+/g, '').DDISH_NM.split('
') + ) error = false errorCode = 0 } else { @@ -76,4 +82,3 @@ export async function getMeal(cityCode: string, schoolCode: number, date: string return { body: meal, error, errorCode } } - From 9227a92ab9443bb6864f8aa50e9c4cc74bd35bb0 Mon Sep 17 00:00:00 2001 From: xnousnow Date: Sun, 7 May 2023 19:59:34 +0900 Subject: [PATCH 03/25] =?UTF-8?q?:bug:=20=EA=B8=89=EC=8B=9D=EC=9D=B4=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=EB=90=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index f0a4501..33f77b6 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -71,7 +71,7 @@ export async function getMeal( if (json.mealServiceDietInfo) { meal = removeAllergyInfo( - json.mealServiceDietInfo[1].row[0].replace(/[^가-힣()]+/g, '').DDISH_NM.split('
') + json.mealServiceDietInfo[1].row[0].DDISH_NM.replace(/[^가-힣
()]+/g, '').split('
') ) error = false errorCode = 0 From 0df3b40640d84bf38151e8cbbce23ce4ad9bc373 Mon Sep 17 00:00:00 2001 From: xnousnow Date: Sun, 7 May 2023 20:08:02 +0900 Subject: [PATCH 04/25] =?UTF-8?q?:bug:=20=EB=A9=94=EB=89=B4=20=EB=92=A4?= =?UTF-8?q?=EC=97=90=20`()`=EA=B0=80=20=EB=B6=99=EB=8A=94=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index 33f77b6..a28de88 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -71,7 +71,7 @@ export async function getMeal( if (json.mealServiceDietInfo) { meal = removeAllergyInfo( - json.mealServiceDietInfo[1].row[0].DDISH_NM.replace(/[^가-힣
()]+/g, '').split('
') + json.mealServiceDietInfo[1].row[0].DDISH_NM.replace(/[^가-힣
]+/g, '').split('
') ) error = false errorCode = 0 From f85060aa5f3a3592dd4205a381f60e950aa7d41a Mon Sep 17 00:00:00 2001 From: xnousnow Date: Sun, 7 May 2023 20:35:54 +0900 Subject: [PATCH 05/25] =?UTF-8?q?:sparkles:=20=EA=B8=89=EC=8B=9D=EC=97=90?= =?UTF-8?q?=EC=84=9C=20`=EC=9A=B0=EC=9C=A0=EA=B8=89=EC=8B=9D`=20=EB=B0=8F?= =?UTF-8?q?=20`=ED=9D=B0=EC=A3=BD(=ED=99=98=EC=95=84=EC=9A=A9)`=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index a28de88..bbc084a 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -71,7 +71,18 @@ export async function getMeal( if (json.mealServiceDietInfo) { meal = removeAllergyInfo( - json.mealServiceDietInfo[1].row[0].DDISH_NM.replace(/[^가-힣
]+/g, '').split('
') + json.mealServiceDietInfo[1].row[0].DDISH_NM.replace(/[^가-힣
]+/g, '').split('
').filter((menu: string) => { + /* + Matches: + - 우유급식 + - 우유우유급식 + - 급식우유 + - 우유 + - 흰죽환아용 + - etc. + */ + return !menu.match(/^(((급식)?(우유){1,2}(급식)?)|흰죽환아용)$/) + }) ) error = false errorCode = 0 From 347625de2cd05e36c987f4e6f46c4634ba0e5c21 Mon Sep 17 00:00:00 2001 From: xnousnow Date: Sun, 7 May 2023 20:36:22 +0900 Subject: [PATCH 06/25] =?UTF-8?q?:sparkles:=20=EA=B8=89=EC=8B=9D=EC=97=90?= =?UTF-8?q?=EC=84=9C=20`/`=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index bbc084a..263e63b 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -71,7 +71,7 @@ export async function getMeal( if (json.mealServiceDietInfo) { meal = removeAllergyInfo( - json.mealServiceDietInfo[1].row[0].DDISH_NM.replace(/[^가-힣
]+/g, '').split('
').filter((menu: string) => { + json.mealServiceDietInfo[1].row[0].DDISH_NM.replace(/[^가-힣
]+/g, '').split('
').filter((menu: string) => { /* Matches: - 우유급식 From 7839ea3b357ebdc6154e93edf22ca128d69da250 Mon Sep 17 00:00:00 2001 From: xnousnow Date: Mon, 8 May 2023 17:02:57 +0900 Subject: [PATCH 07/25] =?UTF-8?q?:art:=20=EB=A9=94=EB=89=B4=20=ED=95=84?= =?UTF-8?q?=ED=84=B0=EB=A7=81=20=EB=B0=A9=EC=8B=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index 263e63b..81b0a04 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -71,19 +71,8 @@ export async function getMeal( if (json.mealServiceDietInfo) { meal = removeAllergyInfo( - json.mealServiceDietInfo[1].row[0].DDISH_NM.replace(/[^가-힣
]+/g, '').split('
').filter((menu: string) => { - /* - Matches: - - 우유급식 - - 우유우유급식 - - 급식우유 - - 우유 - - 흰죽환아용 - - etc. - */ - return !menu.match(/^(((급식)?(우유){1,2}(급식)?)|흰죽환아용)$/) - }) - ) + json.mealServiceDietInfo[1].row[0].DDISH_NM.split('
') + ).map((menu) => cleanMenu(menu)).filter((menu) => !!menu) error = false errorCode = 0 } else { @@ -93,3 +82,11 @@ export async function getMeal( return { body: meal, error, errorCode } } + +export function cleanMenu(menu: string): string { + // 우유 + if (menu.match(/(급식)?\(?우유(급식)?\)?/g)) return '' + // 흰죽 (환아용) + if (menu.match(/흰죽 *\(환아용\)/g)) return '' + return menu.replace(/[^가-힣()]/g, '') +} From 83670f922ce244795646aac8776e75345223ce57 Mon Sep 17 00:00:00 2001 From: xnousnow Date: Mon, 8 May 2023 17:11:49 +0900 Subject: [PATCH 08/25] =?UTF-8?q?:speech=5Fballoon:=20=EC=9A=B0=EC=9C=A0?= =?UTF-8?q?=EC=99=80=20=ED=9D=B0=EC=A3=BD=20`regex`=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index 81b0a04..0f40c1f 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -85,8 +85,8 @@ export async function getMeal( export function cleanMenu(menu: string): string { // 우유 - if (menu.match(/(급식)?\(?우유(급식)?\)?/g)) return '' + if (menu.match(/^ *(급식|강화)?\(?우유(급식)?\)? *$/g)) return '' // 흰죽 (환아용) - if (menu.match(/흰죽 *\(환아용\)/g)) return '' + if (menu.match(/^ *흰죽 *\(환아용\) *$/g)) return '' return menu.replace(/[^가-힣()]/g, '') } From 8a63817384f0f0632ef36186660318eb224cd67a Mon Sep 17 00:00:00 2001 From: xnousnow Date: Mon, 8 May 2023 17:13:36 +0900 Subject: [PATCH 09/25] =?UTF-8?q?:art:=20=EA=B8=B4=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index 0f40c1f..8a38f25 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -72,7 +72,7 @@ export async function getMeal( if (json.mealServiceDietInfo) { meal = removeAllergyInfo( json.mealServiceDietInfo[1].row[0].DDISH_NM.split('
') - ).map((menu) => cleanMenu(menu)).filter((menu) => !!menu) + ).map(cleanMenu).filter(Boolean) error = false errorCode = 0 } else { From 58c372726fcdb72e18a74ee833bf87297cc9671e Mon Sep 17 00:00:00 2001 From: xnousnow Date: Mon, 8 May 2023 17:18:08 +0900 Subject: [PATCH 10/25] =?UTF-8?q?:speech=5Fballoon:=20=EA=B8=89=EC=8B=9D?= =?UTF-8?q?=20=EA=B5=AC=EB=B6=84=EC=9E=90=EC=97=90=20`&`=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index 8a38f25..c422243 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -71,7 +71,7 @@ export async function getMeal( if (json.mealServiceDietInfo) { meal = removeAllergyInfo( - json.mealServiceDietInfo[1].row[0].DDISH_NM.split('
') + json.mealServiceDietInfo[1].row[0].DDISH_NM.split(/|&/g) ).map(cleanMenu).filter(Boolean) error = false errorCode = 0 From 6a5dc11aec49f88344f559cbbf1d4a1aa76a8c0c Mon Sep 17 00:00:00 2001 From: xnousnow Date: Mon, 8 May 2023 17:19:08 +0900 Subject: [PATCH 11/25] =?UTF-8?q?:memo:=20`=EB=AC=B4`=20=EC=98=88=EC=99=B8?= =?UTF-8?q?=EC=97=90=20`=EB=8B=A8=EB=AC=B4=EC=A7=80`=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vegetableData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vegetableData.ts b/src/vegetableData.ts index a754845..76a4861 100644 --- a/src/vegetableData.ts +++ b/src/vegetableData.ts @@ -360,7 +360,7 @@ const vegetableData: Array = [ }, { name: '무', - exceptions: ['열무', '무침', '율무'], + exceptions: ['열무', '무침', '율무', '단무지'], images: [ 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/Japanese_radish_field.jpg/640px-Japanese_radish_field.jpg', 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Korean_radish_%28mu%29.jpg/640px-Korean_radish_%28mu%29.jpg', From c695841d4b92f7339801618e55da4d6e2ccff70e Mon Sep 17 00:00:00 2001 From: xnousnow Date: Mon, 8 May 2023 19:10:28 +0900 Subject: [PATCH 12/25] =?UTF-8?q?:memo:=20`=EB=AC=B4`=20=EC=98=88=EC=99=B8?= =?UTF-8?q?=EC=97=90=20`=EB=AC=B4=EC=8A=A4`=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vegetableData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vegetableData.ts b/src/vegetableData.ts index 76a4861..059840a 100644 --- a/src/vegetableData.ts +++ b/src/vegetableData.ts @@ -360,7 +360,7 @@ const vegetableData: Array = [ }, { name: '무', - exceptions: ['열무', '무침', '율무', '단무지'], + exceptions: ['열무', '무침', '율무', '단무지', '무스'], images: [ 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/Japanese_radish_field.jpg/640px-Japanese_radish_field.jpg', 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Korean_radish_%28mu%29.jpg/640px-Korean_radish_%28mu%29.jpg', From e126f1546dba34bc22b97d59182bdff9d144762c Mon Sep 17 00:00:00 2001 From: xnousnow Date: Mon, 8 May 2023 20:14:46 +0900 Subject: [PATCH 13/25] =?UTF-8?q?:speech=5Fballoon:=20=EC=9A=B0=EC=9C=A0?= =?UTF-8?q?=20=EB=A9=94=EB=89=B4=20=EA=B0=90=EC=A7=80=20`regex`=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index c422243..57648ac 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -85,7 +85,7 @@ export async function getMeal( export function cleanMenu(menu: string): string { // 우유 - if (menu.match(/^ *(급식|강화)?\(?우유(급식)?\)? *$/g)) return '' + if (menu.match(/^ *(급식|강화)?\(?(우유)?(급식)?\)? *$/g)) return '' // 흰죽 (환아용) if (menu.match(/^ *흰죽 *\(환아용\) *$/g)) return '' return menu.replace(/[^가-힣()]/g, '') From 295e2e185712148fbfa49d1a38289f3252daceef Mon Sep 17 00:00:00 2001 From: xnousnow Date: Thu, 11 May 2023 21:41:41 +0900 Subject: [PATCH 14/25] =?UTF-8?q?:lipstick:=20=EB=A9=94=EB=89=B4=EB=B0=94?= =?UTF-8?q?=EC=97=90=20=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MenuBar.svelte | 12 +++++++++++- src/routes/+page.svelte | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/MenuBar.svelte b/src/components/MenuBar.svelte index 526561d..2e2b5ca 100644 --- a/src/components/MenuBar.svelte +++ b/src/components/MenuBar.svelte @@ -1,7 +1,9 @@ Date: Thu, 11 May 2023 21:42:20 +0900 Subject: [PATCH 15/25] =?UTF-8?q?:lipstick:=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EA=B5=AC=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/settings/+page.svelte | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/routes/settings/+page.svelte diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte new file mode 100644 index 0000000..5860ab4 --- /dev/null +++ b/src/routes/settings/+page.svelte @@ -0,0 +1,25 @@ + + + +
+
    +
  • +
  • +
+
    +
  • v1.2.0
  • +
+
From 5ff3a0b2962b38dee517ec56b2edae5fb16a656c Mon Sep 17 00:00:00 2001 From: xnousnow Date: Thu, 11 May 2023 21:46:03 +0900 Subject: [PATCH 16/25] =?UTF-8?q?:speech=5Fballoon:=20`=EC=9A=B0=EC=9C=A0(?= =?UTF-8?q?=EC=9A=B0=EC=9C=A0=EA=B8=89=EC=8B=9D)`=EC=9D=84=20=EA=B0=90?= =?UTF-8?q?=EC=A7=80=ED=95=98=EB=8F=84=EB=A1=9D=20`regex`=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fetchMeal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchMeal.ts b/src/fetchMeal.ts index 57648ac..76ab787 100644 --- a/src/fetchMeal.ts +++ b/src/fetchMeal.ts @@ -85,7 +85,7 @@ export async function getMeal( export function cleanMenu(menu: string): string { // 우유 - if (menu.match(/^ *(급식|강화)?\(?(우유)?(급식)?\)? *$/g)) return '' + if (menu.match(/^ *(급식|강화|우유)?\(?(우유)?(급식)?\)? *$/g)) return '' // 흰죽 (환아용) if (menu.match(/^ *흰죽 *\(환아용\) *$/g)) return '' return menu.replace(/[^가-힣()]/g, '') From 87f1997e83fec287a784ee16ec67d22c00976ef0 Mon Sep 17 00:00:00 2001 From: xnousnow Date: Thu, 11 May 2023 21:49:37 +0900 Subject: [PATCH 17/25] =?UTF-8?q?:speech=5Fballoon:=20=EB=A9=94=EB=89=B4?= =?UTF-8?q?=20=EC=84=A4=EB=AC=B8=20=EC=B0=B8=EA=B0=80=20=ED=86=A0=EA=B8=80?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/settings/+page.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte index 5860ab4..afc95e4 100644 --- a/src/routes/settings/+page.svelte +++ b/src/routes/settings/+page.svelte @@ -9,7 +9,7 @@