# HG changeset patch # User Steve Losh # Date 1245302090 14400 # Node ID afec18ea1700d4234b4d0c09754239857e0c2b98 # Parent 94edcb30827fe1dce8f3cd56c1885aa0308fcd8d Remove extraneous feeds and bird feeder stuff. diff -r 94edcb30827f -r afec18ea1700 deploy-template.py --- a/deploy-template.py Mon Jun 15 20:34:01 2009 -0400 +++ b/deploy-template.py Thu Jun 18 01:14:50 2009 -0400 @@ -13,7 +13,4 @@ # start a new project. SECRET_KEY = '' -# This is used for the Mint (http://haveamint.com/) Bird Feeder plugin hack. -FEEDER_PASSWORD = '' - AKISMET_API_KEY = '' diff -r 94edcb30827f -r afec18ea1700 rss/feeds.py --- a/rss/feeds.py Mon Jun 15 20:34:01 2009 -0400 +++ b/rss/feeds.py Thu Jun 18 01:14:50 2009 -0400 @@ -4,30 +4,6 @@ import operator -feeder = "http://stevelosh.com/feeder" - -class LatestEntries(Feed): - title = "Steve Losh / RSS / Blog" - link = "http://stevelosh.com/blog" - description = "Latest blog entries on stevelosh.com" - - item_author_name = 'Steve Losh' - item_author_email = 'steve@stevelosh.com' - item_author_link = 'http://stevelosh.com' - - def items(self): - return Entry.objects.filter(published=True).order_by('-pub_date')[:10] - - def item_pubdate(self, item): - return item.pub_date - - def item_link(self, item): - return '%s/?FeederAction=clicked&feed=%s&seed=%s&seed_title=%s' % \ - (feeder, - 'Blog', - self.item_author_link + item.get_absolute_url(), - 'Steve Losh / ' + item.title) - class LatestComments(Feed): title = "Steve Losh / RSS / Comments" link = "http://stevelosh.com/blog" @@ -50,37 +26,11 @@ return item.submitted def item_link(self, item): - return '%s/?FeederAction=clicked&feed=%s&seed=%s&seed_title=%s' % \ - (feeder, - 'Comments', - self.item_author_link + item.get_absolute_url(), - 'Comment %d' % item.id) - -class LatestProjects(Feed): - title = "Steve Losh / RSS / Projects" - link = "http://stevelosh.com/projects" - description = "Latest projects on stevelosh.com" - - item_author_name = 'Steve Losh' - item_author_email = 'steve@stevelosh.com' - item_author_link = 'http://stevelosh.com' - - def items(self): - return Project.objects.order_by('-posted')[:10] - - def item_pubdate(self, item): - return item.posted - - def item_link(self, item): - return '%s/?FeederAction=clicked&feed=%s&seed=%s&seed_title=%s' % \ - (feeder, - 'Projects', - self.item_author_link + item.get_absolute_url(), - 'Steve Losh / ' + item.name) + return item.get_absolute_url() class LatestEverything(Feed): - title = "Steve Losh / RSS / All" + title = "Steve Losh" link = "http://stevelosh.com" description = "Latest updates from stevelosh.com" @@ -108,9 +58,5 @@ title = 'Steve Losh / ' + item['title'] new_link = item['item'].get_absolute_url() - return '%s/?FeederAction=clicked&feed=%s&seed=%s&seed_title=%s' % \ - (feeder, - 'All', - new_link, - title) + return new_link diff -r 94edcb30827f -r afec18ea1700 rss/models.py --- a/rss/models.py Mon Jun 15 20:34:01 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff -r 94edcb30827f -r afec18ea1700 rss/urls.py --- a/rss/urls.py Mon Jun 15 20:34:01 2009 -0400 +++ b/rss/urls.py Thu Jun 18 01:14:50 2009 -0400 @@ -1,11 +1,10 @@ from django.conf.urls.defaults import * from stevelosh.rss.feeds import * -feeds = { 'blog': LatestEntries, - 'comments': LatestComments, - 'projects': LatestProjects, +feeds = { 'comments': LatestComments, 'all': LatestEverything, } -urlpatterns = patterns('rss.views', - url(r'^(?P.+)/$', 'feeds', {'feed_dict': feeds}), +urlpatterns = patterns('', + url(r'^(?P.+)/$', 'django.contrib.syndication.views.feed', + {'feed_dict': feeds}), ) \ No newline at end of file diff -r 94edcb30827f -r afec18ea1700 rss/views.py --- a/rss/views.py Mon Jun 15 20:34:01 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -from stevelosh.deploy import FEEDER_PASSWORD -import urllib2 -import django.contrib.syndication.views - -def feeds(request, url, feed_dict): - headers = {'HTTP_HOST':'Host', - 'HTTP_USER_AGENT':'User-Agent', - 'HTTP_ACCEPT_ENCODING':'Accept-Encoding', - 'HTTP_ACCEPT_LANGUAGE':'Accept-Language', - 'HTTP_REFERER':'Referer', - 'HTTP_COOKIE':'Cookies'} - - feed_name = [p.capitalize() for p in url.split('/') if p.strip() != ''][-1] - - # Call into BirdFeeder with the request headers. - o = urllib2.build_opener() - o.addheaders = [ (headers[k], request.META.get(k, '')) - for k in request.META.keys() if k in headers.keys()] - f = o.open( "http://stevelosh.com/feeder/index.php?pw=%s&feed_name=%s" % - (FEEDER_PASSWORD, feed_name) ) - f.read() - f.close() - - return django.contrib.syndication.views.feed(request, url=url, - feed_dict=feed_dict) \ No newline at end of file