afec18ea1700

Remove extraneous feeds and bird feeder stuff.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 18 Jun 2009 01:14:50 -0400
parents 94edcb30827f
children b1e6fe413102
branches/tags (none)
files deploy-template.py rss/feeds.py rss/models.py rss/urls.py rss/views.py

Changes

--- 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 = ''
--- 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
     
--- 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.
--- 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<url>.+)/$', 'feeds', {'feed_dict': feeds}),
+urlpatterns = patterns('',
+    url(r'^(?P<url>.+)/$', 'django.contrib.syndication.views.feed', 
+        {'feed_dict': feeds}),
 )
\ No newline at end of file
--- 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