make content, fix links for bistros, fix images in cafekarsten and lichtblick/sternwarte, fix layout in lichtblick/sternwarte
This commit is contained in:
@@ -3,6 +3,8 @@ import urllib.request
|
||||
from bs4 import BeautifulSoup
|
||||
import datetime
|
||||
|
||||
days = ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag"]
|
||||
|
||||
def suppe(url):
|
||||
page = urllib.request.urlopen(url).read()
|
||||
return BeautifulSoup(page, "html.parser")
|
||||
@@ -15,13 +17,39 @@ def grangusto():
|
||||
return f'<img width=100% src={suppe("https://gran-gusto.de/wochenmenue-kiga/").find("img", class_="img-with-animation")["src"]}>'
|
||||
|
||||
def sternwarte():
|
||||
return str(suppe("https://www.pommerscher-diakonieverein.de/produkte-dienstleistungen/gastronomie-hotellerie/bio-bistro-alte-sternwarte/").find("div", class_="ce-week-menu"))
|
||||
fullsupp = suppe("https://www.pommerscher-diakonieverein.de/produkte-dienstleistungen/gastronomie-hotellerie/bio-bistro-alte-sternwarte/")
|
||||
menu = fullsupp.find("div", class_="ce-week-menu")
|
||||
menu.ul.clear()
|
||||
for n, d in enumerate(menu.find_all("div", class_='tab-pane')):
|
||||
d.div.div.div.replace_with(fullsupp.new_tag("h3"))
|
||||
d.div.div.h3.string = days[n]
|
||||
for i in menu.find_all("img"):
|
||||
i['src'] = ""
|
||||
i['height'] = 0
|
||||
i['width'] = 0
|
||||
for b in menu.find_all("br"):
|
||||
b.name = ""
|
||||
return str(menu)
|
||||
|
||||
def lichtblick():
|
||||
return str(suppe("https://www.pommerscher-diakonieverein.de/produkte-dienstleistungen/gastronomie-hotellerie/lichtblick-cafe-und-restaurant").find("div", class_="ce-week-menu"))
|
||||
fullsupp = suppe("https://www.pommerscher-diakonieverein.de/produkte-dienstleistungen/gastronomie-hotellerie/lichtblick-cafe-und-restaurant")
|
||||
menu = fullsupp.find("div", class_="ce-week-menu")
|
||||
menu.ul.clear()
|
||||
for n, d in enumerate(menu.find_all("div", class_='tab-pane')):
|
||||
d.div.div.div.replace_with(fullsupp.new_tag("h3"))
|
||||
d.div.div.h3.string = days[n]
|
||||
for i in menu.find_all("img"):
|
||||
i['src'] = ""
|
||||
i['height'] = 0
|
||||
i['width'] = 0
|
||||
for b in menu.find_all("br"):
|
||||
b.name = ""
|
||||
return str(menu)
|
||||
|
||||
def cafekarsten():
|
||||
return str(suppe("https://cafekarsten.de/").find("div", class_="lg:grid-cols-2"))
|
||||
menu = suppe("https://cafekarsten.de/").find("div", class_="lg:grid-cols-2")
|
||||
menu.find("img")['src'] = ""
|
||||
return str(menu)
|
||||
|
||||
def tierpark():
|
||||
seite = suppe("https://www.tierpark-greifswald.de/tierpark-cafe.html").find("div", id="tierpark-cafe")
|
||||
@@ -35,13 +63,13 @@ def malanders():
|
||||
|
||||
bistros = {
|
||||
"S-Sbar": {"f": sbar, "url": "https://sbar-greifswald.de"},
|
||||
"Gran Gusto": {"f": grangusto, "url": "https://sbar-greifswald.de"},
|
||||
"Bio-Bistro Alte Sternwarte": {"f": sternwarte, "url": "https://sbar-greifswald.de"},
|
||||
"Bistro Lichtblick": {"f": lichtblick, "url": "https://sbar-greifswald.de"},
|
||||
"Cafe Karsten": {"f": cafekarsten, "url": "https://sbar-greifswald.de"},
|
||||
"Tierparkcafe": {"f": tierpark, "url": ""},
|
||||
"Gran Gusto": {"f": grangusto, "url": "https://gran-gusto.de/wochenmenue-kiga"},
|
||||
"Bio-Bistro Alte Sternwarte": {"f": sternwarte, "url": "https://www.pommerscher-diakonieverein.de/produkte-dienstleistungen/gastronomie-hotellerie/bio-bistro-alte-sternwarte/"},
|
||||
"Bistro Lichtblick": {"f": lichtblick, "url": "https://www.pommerscher-diakonieverein.de/produkte-dienstleistungen/gastronomie-hotellerie/lichtblick-cafe-und-restaurant"},
|
||||
"Cafe Karsten": {"f": cafekarsten, "url": "https://cafekarsten.de/"},
|
||||
"Tierparkcafe": {"f": tierpark, "url": "https://www.tierpark-greifswald.de/tierpark-cafe.html"},
|
||||
"IPP-Kantine": {"f": ipp, "url": "https://ipp-kantine.de"},
|
||||
"Mal Anders": {"f": malanders, "url": "https://sbar-greifswald.de"},
|
||||
"Mal Anders": {"f": malanders, "url": "https://mal-anders-greifswald.dipago.de"},
|
||||
}
|
||||
|
||||
with open("index.html", "w") as f:
|
||||
@@ -52,10 +80,14 @@ with open("index.html", "w") as f:
|
||||
""")
|
||||
|
||||
f.write(f"zuletzt aktualisiert: {datetime.datetime.now().strftime('%d.%m.%Y %H:%M')}<br>")
|
||||
|
||||
f.write("<list>")
|
||||
for b in bistros:
|
||||
f.write(f"<ul><a href='#{b}'>{b}</a>: <a href='{bistros[b]['url']}'>Webseite</a></ul>")
|
||||
f.write("\n")
|
||||
f.write("</list>\n<br><br>\n")
|
||||
|
||||
for b in bistros:
|
||||
f.write(f"<h2>{b}</h2>\n")
|
||||
f.write(f"<h1><a name='#{b}'></a>{b}</h1>\n")
|
||||
try:
|
||||
f.write(bistros[b]['f']())
|
||||
f.write("\n")
|
||||
|
||||
Reference in New Issue
Block a user