Skip to content

Eckhoff42/TerminalMenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

UiO menu checker

This is a commandline tool used to check todays menu at all SiO restaurants. The tool should be able to handle restaurants being added/removed as long as they follow the same structure on the page.

How to run the program

Download the repo:

[email protected]:Eckhoff42/TerminalMenu.git

Navigate into to the file main.py

cd TerminalMenu

Run the program

python3 main.py "<restaurant name>"
# to se the list of SiO restaurants run 
python3 main.py -l
# to get help use the command
python3 main.py -h

Demo:

render1645720353083

implementation

The script is written in python using BeautifulSoup.

  1. The website "https://www.sio.no/mat-og-drikke/spisesteder-og-kaffebarer" is fetched
  2. Using BeautifulSoup the each div containing a restaurant is found.
  3. Name of restaurant, menu headings and menu is found for each restaurant
  4. The result is added to a 2d dictionary. The structure is described below
  5. An argparser is used to parse the user-query

result dictionary structure

{
  "restaurant_1" : {"title_1" : "text_1", "title_2": "text_2"},
  "restaurant_2" : {"title_3": "text_3"},
  "restaurant_3" : {} //this restaurant has no menu
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages