Permalink
Browse files

blogspot support

  • Loading branch information...
1 parent de94f79 commit c071afc76867dedf7664579c92b854a318ab0d09 @pote committed May 4, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/planet.rb
View
@@ -114,9 +114,21 @@ def fetch
end
feed.entries.each do |entry|
+ ## TODO: I should probably consider using feed 'adapters' for specific
+ ## blog engine feeds that don't have their stuff on the standard fields.
+ ## Example: blogspot has the content on "summary" instead of content ¬¬.
+ content = if !entry.content.nil?
+ self.sanitize_images(entry.content.strip)
+ elsif !entry.summary.nil?
+ self.sanitize_images(entry.summary.strip)
+ else
+ abort "=> No content found on entry"
+ end
+
+
self.posts << @post = Post.new(
title: entry.title.sanitize,
- content: self.sanitize_images(entry.content.strip),
+ content: content,
date: entry.published,
url: self.url + entry.url,
blog: self

0 comments on commit c071afc

Please sign in to comment.