From 9bc9b213fb5849b20c965b7bd6695b5796ba19ae Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 31 Mar 2016 11:09:08 -0400 Subject: added support for Facebook Instant Articles to syndication app --- app/syndication/views.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/syndication/views.py (limited to 'app/syndication/views.py') diff --git a/app/syndication/views.py b/app/syndication/views.py new file mode 100644 index 0000000..e489846 --- /dev/null +++ b/app/syndication/views.py @@ -0,0 +1,17 @@ +from django.views.generic import ListView + +from .models import SyndicatedItem + + +class FacebookFeedView(ListView): + """ + Return a main entry and list of Entries in reverse chronological order + """ + queryset = SyndicatedItem.objects.filter(syndicate__name__exact="Facebook")[:16] + + def get_template_names(self): + return "fb-feed.xml" + + def render_to_response(self, context, **response_kwargs): + response_kwargs.update({'content_type': 'text/xml'}) + return super(FacebookFeedView, self).render_to_response(context, **response_kwargs) -- cgit v1.2.3-70-g09d2