Bug #5688

Feeds don't need the whole body

Added by yossarian over 3 years ago. Updated over 3 years ago.

Status:Closed Start:11/20/2008
Priority:Normal Due date:
Assigned to:Dan % Done:

100%

Category:Content
Target version:0.6 - post-launch cleanup Estimated time:1.00 hour
Resolution:

fixed


Description

It's stupid to have the whole body text in the feed, knock it down to just title and summary.

History

Updated by yossarian over 3 years ago

So, this would get worked on in: http://projects.escapegoat.org/repositories/entry/hyperactive/app/controllers/feeds_controller.rb

There's also another ticket somewhere to split up the feeds so that we get like an "articles_by_tag" and "articles_by_place" feed. Currently the method that calls itself an events feed is actually not an events feed anymore, it's an everything-feed, so that also needs to be split up, but that can be a separate ticket.

Updated by Dan over 3 years ago

  • Status changed from New to Assigned
  • Assigned to set to Dan

Updated by yossarian over 3 years ago

Digging through the code a bit more, the actual feed generation takes place here:

http://projects.escapegoat.org/repositories/entry/hyperactive/vendor/plugins/resource_feeder/lib/resource_feeder/rss.rb

Line 33 of that file has:

options[:item][:description]     ||= [ :description, :body, :content ]

I think our summary field is actually called "summary". In theory, setting lines 87-89 of the FeedsController from:

    options = {:feed => {:title => feedtitle,    
              :item => {:pub_date => :date },
              :link => {:controller => 'events', :action => 'show'}}
              }

To something like:

    options = {:feed => {:title => feedtitle,    
              :item => {:pub_date => :date, :description => :summary },
              :link => {:controller => 'events', :action => 'show'}}
              }

I had some weird-ass troubles with the resource_feeder plugin when trying to change things like this, but try that out and see what happens.

Updated by Dan over 3 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100
  • Resolution set to fixed

I've changed the way that the feeds are working to avoid the complicated plumbing that was going on. The feeds are now defined in .rxml files in the app/views/feeds folder. These files can be edited independently of each other, and can be changed without a webbrick restart. I've broken them all out into separate files, but it would be easy to consolidate them if that what people think is best.

Yossarian- maybe we don't need the plugin in /vendor anymore? I'm also not sure what impact my commit has on atom feeds- I didn't see how the previous code offered this choice either?

Updated by yossarian over 3 years ago

GREAT! Beers on me.

I've knocked simply_helpful and resource_feeder out of the plugins lib. Your way is much cleaner and simpler, although I think that the resource_feeder would respond automatically to either RSS or Atom, based on the request headers. In practice it probably doesn't matter too much, most clients are going to be able to handle either/or.

Updated by yossarian over 3 years ago

  • Status changed from Resolved to Closed

Closing.

Also available in: Atom PDF