Browse Source

pyi2phosts/lib/rss.py: add subclass for freshy added hosts

pull/1/head
Hidden Z 14 years ago
parent
commit
ccfd0d2494
  1. 13
      pyi2phosts/lib/rss.py

13
pyi2phosts/lib/rss.py

@ -2,6 +2,7 @@ @@ -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): @@ -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()

Loading…
Cancel
Save