From fa61ab2733b46e3c40ffe583768aa126a4e99da2 Mon Sep 17 00:00:00 2001 From: pierregeeraert Date: Tue, 30 Jun 2026 15:57:36 +0100 Subject: [PATCH] run the podcast through an url --- django_code/apps/podcast_aggregator/utils.py | 8 ++++++-- django_code/apps/podcast_aggregator/views.py | 6 +++++- django_code/core/urls.py | 5 +++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/django_code/apps/podcast_aggregator/utils.py b/django_code/apps/podcast_aggregator/utils.py index 585f90f..b0e3990 100644 --- a/django_code/apps/podcast_aggregator/utils.py +++ b/django_code/apps/podcast_aggregator/utils.py @@ -37,8 +37,12 @@ def pretty_filename(filename,extension=''): extension = str('.'+extension) return pretty_filename+extension -def main(): +def podcasts(): telegram = telegramUtils() + + #clear all expired messages before + telegram.clear_expired_messages() + url = "https://feeds.audiomeans.fr/feed/44f6a116-20a6-44c4-98c4-b3e1bdd46dce.xml" today_podcast = rss_to_dict(url) print(today_podcast) @@ -46,4 +50,4 @@ def main(): download_news_mp3(today_podcast[2],file) telegram.send_document(file,str(today_podcast[0])+" "+str(today_podcast[1])) -main() \ No newline at end of file +#main() \ No newline at end of file diff --git a/django_code/apps/podcast_aggregator/views.py b/django_code/apps/podcast_aggregator/views.py index 91ea44a..a1e59bb 100644 --- a/django_code/apps/podcast_aggregator/views.py +++ b/django_code/apps/podcast_aggregator/views.py @@ -1,3 +1,7 @@ -from django.shortcuts import render +from django.http import HttpResponse +from .utils import podcasts # Create your views here. +def execute_podcast(request): + podcasts() + return HttpResponse('

Generating the podcast!

') diff --git a/django_code/core/urls.py b/django_code/core/urls.py index 1efd1b5..95279d1 100644 --- a/django_code/core/urls.py +++ b/django_code/core/urls.py @@ -26,6 +26,7 @@ from apps.kubernetes_connection import apps as kubernetes_connection from apps.stash_management import apps as stashapp from apps.stash_management import views as stashview from apps.website_redirection import views as website_redirectionapp +from apps.podcast_aggregator import views as podcast_views urlpatterns = [ @@ -89,4 +90,8 @@ urlpatterns = [ #path('change-schedule/', cloudmanager_views.change_schedule, name='change_schedule'), #path('cmm/main/', db_interaction.main), + ################### cloudmanager ################### + path('podcast/', podcast_views.execute_podcast), + + ]