diff options
author | Franck Cuny <franck@fcuny.net> | 2024-10-14 17:23:43 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2024-10-14 17:23:43 -0700 |
commit | d1352643d5a19da472343d6151e4cac0e335b61b (patch) | |
tree | 8efad3b693f266dcb9bfd88eec0f33d4006bbe14 /src | |
parent | backup the repositories (diff) | |
download | world-d1352643d5a19da472343d6151e4cac0e335b61b.tar.gz |
delete a bunch of python related stuff
Diffstat (limited to 'src')
-rwxr-xr-x | src/cli/pizza.py | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/cli/pizza.py b/src/cli/pizza.py deleted file mode 100755 index d07abc8..0000000 --- a/src/cli/pizza.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 - -from textwrap import fill - -import requests -from bs4 import BeautifulSoup -from termcolor import colored -from prettytable import PrettyTable - -url = "https://cheeseboardcollective.coop/pizza/" - - -def main(): - content = requests.get(url) - soup = BeautifulSoup(content.text, "html.parser") - - magic_ingredients = ["corn"] - - table = PrettyTable() - table.field_names = ["date", "pizza"] - table.align = "l" - - pizzas = soup.select(".pizza-list > article") - for pizza in pizzas: - date_color = "white" - menu_color = "white" - - date = pizza.find(class_="date").text - - # the pizza is the 1st element, the 2nd is the salad, and i don't - # care about the salad :) - menu = pizza.select(".menu > p:nth-of-type(1)")[0].get_text(strip=True, separator="\n").split("\n") - - if "closed" in menu[0]: - date_color = "red" - - if "Parbake pizza is available" in menu[0]: - menu.pop(0) - - if "Lunch from" in menu[0]: - menu.pop(0) - - if "No hot pizza today" in menu[0]: - menu.pop(0) - - final_menu = "".join(menu) - - for ingredient in magic_ingredients: - if ingredient in final_menu: - menu_color = "yellow" - - table.add_row([colored(date, date_color), fill(colored(final_menu, menu_color), width=80)]) - - print(table) |