Initial commit

This commit is contained in:
2021-04-28 20:38:23 +03:00
commit 44a19bfc07
3 changed files with 29 additions and 0 deletions

7
README.md Normal file
View File

@@ -0,0 +1,7 @@
# beer-price
Кому нужен `neofetch`? Я и так знаю какая у меня операционка
и сколько у меня оперативной памяти.
Лучше получать более важную информацию при запуске терминала,
например сколько сегодня в среднем стоит пиво в баре "Выдержка" в "Этажах".

20
beer.py Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/python3
# coding=UTF-8
import sys
sys.path.append('/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages')
import requests
from bs4 import BeautifulSoup
url = "https://spb.bar"
req = requests.get(url)
soup = BeautifulSoup(req.content, 'html.parser')
rows = soup("tr")
prices = [int(row("td")[-1].text[:-2]) for row in rows]
mean = sum(prices)/len(prices)
print("🍺 · " + str(round(mean)) + "")
print("🍺 ⥶ " + str(min(prices)) + "")

2
requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
bs4
requests