elektricity/repod/podcast.py

19 lines
510 B
Python
Raw Normal View History

"""
Base skeleton for what needs to be implemented by a podcast provider
"""
from feedgen.feed import FeedGenerator
from pyramid.response import Response
2016-05-07 11:09:55 -04:00
class BasePodcast():
2016-05-07 11:09:55 -04:00
def build_feed(self) -> FeedGenerator:
"Return a list of all episodes, in descending date order"
pass
def view(self, request):
fg = self.build_feed()
response = Response(fg.rss_str(pretty=True))
response.content_type = 'application/rss+xml'
return response