Added Montagsküche
This commit is contained in:
parent
841cb719fa
commit
c70fd1de9f
15
app.py
15
app.py
@ -3,6 +3,8 @@
|
||||
|
||||
import os
|
||||
from flask import Flask,redirect
|
||||
from bs4 import BeautifulSoup
|
||||
import requests
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@ -103,6 +105,19 @@ def bh_club():
|
||||
def bi_club():
|
||||
return redirect("https://www.bi-club.de/", code=302)
|
||||
|
||||
# Montagsküche
|
||||
@app.route('/montag/')
|
||||
def montagskueche():
|
||||
try:
|
||||
posts = requests.get("https://www.bi-club.de/tags/montagskueche")
|
||||
soup = BeautifulSoup(posts.text, 'html.parser')
|
||||
link = soup.find(id='main').article.header.h2.a.get('href')
|
||||
return redirect("https://www.bi-club.de" + link, code=302)
|
||||
except:
|
||||
return redirect("https://www.bi-club.de/tags/montagskueche", code=302)
|
||||
|
||||
|
||||
|
||||
########################################################################################################################
|
||||
# Stura
|
||||
########################################################################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user