Code Monkey home page Code Monkey logo

bugobot's Introduction

BugoBot

The BugoBot, Discord bot, is developed for all students of Bucheon High School. But if you change some dummy codes, you can create your own service!

Food Menu API

You can get a school food menu as JSON via an HTTP GET request. So data can be called from any platform.

When a meal is requested more than once, the meal is saved on the server by the requested school, year, and month, greatly improving response speed. Also support elementary, middle, and high schools in Korea.

School Type

  • Elementay School : elementary
  • Middle School : middle
  • High school : high

School Code

You can get your school code here!

Then go to the lunch_api.py code and fix this one:

# get url
self.today_url = 'https://schoolmenukr.ml/api/your_school_type/your_school_code?year=2022&allergy=hidden' + today_month + today_date
self.tomorrow_url = 'https://schoolmenukr.ml/api/your_school_type/your_school_code?year=2022&allergy=hidden' + tomorrow_month + tomorrow_date

Fix your_school_type type and your_school_code!

Import Meal Menu

https://schoolmenukr.ml/api/your_school_type/your_school_code is the main address. And you can add more condition of address.

Parameter

This part is optional.

https://schoolmenukr.ml/api/your_school_type/your_school_code?[variable_name1]=[value1]&[variable_name2]=[value2]

Variable Name Explanation Initial Value
year By specifying a specific year, the menu corresponding to that year is loaded. Year of current date
month By specifying a specific month, the menu for that month is called up. Month of current date
date By specifying a specific day, the menu for that day is called up. Day of current date
allergy When set to 'hidden', allergy information is not displayed, and when set to 'formed', information is displayed structured. None

Example

Python

import requests
import json

url = 'https://schoolmenukr.ml/api/middle/X123456789?year=2018&month=5'
response = requests.get(url)
school_menu = json.loads(response.text)
print(school_menu)

Result

{
    menu: [
        ...,
        {
            date:"5",
            breakfast:["찹쌀밥","홍합미역국5.6.","닭갈비5.6.13.","김구이13.","배추김치9.13.","방울토마토12."],
            lunch:["흑미밥","콩나물국5.13.","돼지등뼈김치찜9.10.13.","도토리묵무침5.6.13.","총각김치9.13.","청포도"],
            dinner:["찹쌀밥","오징어짬뽕국5.6.","배추겉절이13.","포도쥬스5.13.","만두오꼬노미야끼1.5.6.10.12.13."]
        },
        ...
    ],
    server_message: ["foo", "bar", ...]
}

License

© 2022, BugoBot. Released under GNU General Public License v3.0.

BugoBot is authored and maintained by @CharlesbrownK.

bugobot's People

Contributors

charlesbrownk avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.