Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Remove unnecessary functions
Browse files Browse the repository at this point in the history
-> Removed 'meal_info'
  • Loading branch information
BackGwa committed Nov 6, 2022
1 parent bb881de commit 89d1a72
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions johnson.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
today = datetime.today()


# [함수] : API로 급식 정보 JSON 반환하기
def meal_info(school_type, school_code, year, month, day, aleg):
allergy = 'formed' if (aleg == True) else 'hidden'
return f'https://schoolmenukr.ml/api/{school_type}/{school_code}?year={year}&month={month}&date={day}&allergy={allergy}'


# [함수] : 필요한 정보만 반환하기
def meal_zone(JSON, usetime, meal_value):

Expand Down Expand Up @@ -58,7 +52,9 @@ def aleg_info(mealinfo):
# [함수] : 급식 정보 가져오기
def now(school_type, school_code, get_value = [today.year, today.month, today.day], aleg = False, usetime = True, zonevalue = 'NoneValue'):

API = meal_info(school_type, school_code, get_value[0], get_value[1], get_value[2], aleg)
allergy = 'formed' if (aleg == True) else 'hidden'

API = f'https://schoolmenukr.ml/api/{school_type}/{school_code}?year={get_value[0]}&month={get_value[1]}&date={get_value[2]}&allergy={allergy}'
response = requests.get(API)

result = meal_zone(response, usetime, zonevalue)
Expand Down

0 comments on commit 89d1a72

Please sign in to comment.