Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

blogspot support

  • Loading branch information...
commit c071afc76867dedf7664579c92b854a318ab0d09 1 parent de94f79
@pote authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/planet.rb
View
14 lib/planet.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.