added todos
This commit is contained in:
parent
2e28361c75
commit
8f5849e97d
16 changed files with 13 additions and 4 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -5,7 +5,7 @@ import feedparser
|
|||
|
||||
FEED_URL="https://blauwasser-mausis.de/rss.xml"
|
||||
|
||||
def check_blog_rss_and_send_mail():
|
||||
def check_blog_rss_and_send_admin_mail():
|
||||
feed = feedparser.parse(FEED_URL)
|
||||
for article in feed.entries:
|
||||
date_string = str(article["published"])
|
||||
|
|
@ -13,4 +13,11 @@ def check_blog_rss_and_send_mail():
|
|||
|
||||
if date_object > (datetime.now() - timedelta(days=1)):
|
||||
print(f"Neu: {article["title"]}")
|
||||
# TODO: Send Mail to Tim to power on newsletter
|
||||
title = str(article["title"])
|
||||
description = str(article["summary"])
|
||||
|
||||
# TODO: create link
|
||||
# TODO: create Template with jinja2
|
||||
# TODO: send mail to blauwasser-mausis@proton.me
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from backend.internal.xml_reader import check_blog_rss_and_send_mail
|
||||
from backend.internal.xml_reader import check_blog_rss_and_send_admin_mail
|
||||
from .routers import users, comments
|
||||
from backend.internal.database import create_db_and_tables
|
||||
from fastapi import APIRouter
|
||||
|
|
@ -6,7 +6,9 @@ from fastapi import FastAPI
|
|||
from fastapi_crons import Crons, get_cron_router
|
||||
|
||||
|
||||
# TODO: Newsletter
|
||||
# TODO: env
|
||||
# TODO: TLS
|
||||
# TODO: Deploy
|
||||
|
||||
app = FastAPI()
|
||||
|
|
@ -14,7 +16,7 @@ crons = Crons(app)
|
|||
|
||||
@crons.cron("0 14 * * *", name="RSS-Check")
|
||||
async def check_for_new_article():
|
||||
check_blog_rss_and_send_mail()
|
||||
check_blog_rss_and_send_admin_mail()
|
||||
|
||||
|
||||
@app.on_event("startup")
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue