feat: Added all code for project

This commit is contained in:
Nicholas Novak 2024-02-21 17:26:36 -08:00
commit 1fb3c45f97
3 changed files with 73 additions and 0 deletions

31
PKGBUILD Normal file
View File

@ -0,0 +1,31 @@
# Maintainer: Nicholas Novak <nicholasmnovak@gmail.com>
pkgname=mpcli
pkgver=r82.66ac237
pkgrel=1
pkgdesc="Marketplace CLI"
arch=('any')
makedepends=('git')
provides=('mpcli')
depends=('go')
makedepends=('python-build' 'python-installer' 'python-wheel')
url=""
source=(
"mpcli::git+ssh://git@git.nicholasnovak.io:/nnovak/mpcli.git"
)
md5sums=('SKIP')
pkgver() {
cd "$srcdir/mpcli"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir/mpcli"
python -m build --wheel --no-isolation
}
package() {
cd "$srcdir/mpcli"
python -m installer --destdir="$pkgdir" dist/*.whl
}

35
scrape.py Normal file
View File

@ -0,0 +1,35 @@
import requests
from bs4 import BeautifulSoup
from datetime import date
from typing import List
base_url = "https://www.oxy.edu/student-life/campus-dining/where-eat/marketplace"
days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
def print_day(day_name: str) -> None:
resp = requests.get(base_url)
soup = BeautifulSoup(resp.content, "html.parser")
day = soup.find(id=day_name)
print(day.parent.text)
start = day.parent.parent.parent.find_next("p").find_next("p")
print("\nBreakfast\n")
print(start.text)
start = start.find_next("p")
print("\nLunch\n")
print(start.text)
start = start.find_next("p")
print("\nDinner\n")
print(start.text)
today = date.today()
print_day(days[today.weekday()])

7
setup.py Normal file
View File

@ -0,0 +1,7 @@
from distutils.core import setup
setup(
name="mpcli",
version="1.0",
py_modules=["setup"],
)