From ccfd0d2494cb0d61f50571451e39984f9a2c9aa4 Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Wed, 16 Feb 2011 18:59:13 +0000 Subject: [PATCH] pyi2phosts/lib/rss.py: add subclass for freshy added hosts --- pyi2phosts/lib/rss.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pyi2phosts/lib/rss.py b/pyi2phosts/lib/rss.py index e448174..b61838f 100755 --- a/pyi2phosts/lib/rss.py +++ b/pyi2phosts/lib/rss.py @@ -2,6 +2,7 @@ from django.contrib.syndication.views import Feed from pyi2phosts.postkey.models import i2phost +from pyi2phosts.latest.views import get_latest import settings @@ -24,3 +25,15 @@ class AliveHostsFeed(Feed): def item_description(self, item): return item.description + + +class LatestHostsFeed(AliveHostsFeed): + """ Generate RSS feed with freshly added hosts """ + + title = settings.DOMAIN + ' latest hosts' + # FIXME: make this URL more dynamic + link = 'http://' + settings.DOMAIN + '/latest/' + description = 'Freshly added hosts' + + def items(self): + return get_latest()