This commit is contained in:
@@ -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()
|
||||
#main()
|
||||
@@ -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('<h1>Generating the podcast!</h1>')
|
||||
|
||||
@@ -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),
|
||||
|
||||
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user