summaryrefslogtreecommitdiff
path: root/app/syndication/views.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2016-03-31 11:09:08 -0400
committerluxagraf <sng@luxagraf.net>2016-03-31 11:09:08 -0400
commit9bc9b213fb5849b20c965b7bd6695b5796ba19ae (patch)
treebfe475dee42e6ebc814fb1d6c0f270df3627f814 /app/syndication/views.py
parentf81d4cdc61baf6904746ace7226eb6031de32b1a (diff)
added support for Facebook Instant Articles to syndication app
Diffstat (limited to 'app/syndication/views.py')
-rw-r--r--app/syndication/views.py17
1 files changed, 17 insertions, 0 deletions
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)