Skip to content

Commit

Permalink
patch for AtomFeedBurnerEntry to fall back on rel=alternate
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Chupp committed Feb 18, 2009
1 parent 4074877 commit 5f12e3d
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/feedzirra/atom_feed_burner_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class AtomFeedBurnerEntry
include FeedEntryUtilities
element :title
element :name, :as => :author
element :link, :as => :url, :value => :href, :with => {:type => "text/html", :rel => "alternate"}
element :"feedburner:origLink", :as => :url
element :summary
element :content
Expand Down
5 changes: 5 additions & 0 deletions spec/feedzirra/atom_feed_burner_entry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
@entry.title.should == "Making a Ruby C library even faster"
end

it "should be able to fetch a url via the 'alternate' rel if no origLink exists" do
entry = Feedzirra::AtomFeedBurner.parse(File.read("#{File.dirname(__FILE__)}/../sample_feeds/PaulDixExplainsNothingAlternate.xml")).entries.first
entry.url.should == 'http://feeds.feedburner.com/~r/PaulDixExplainsNothing/~3/519925023/making-a-ruby-c-library-even-faster.html'
end

it "should parse the url" do
@entry.url.should == "http://www.pauldix.net/2009/01/making-a-ruby-c-library-even-faster.html"
end
Expand Down
Loading

0 comments on commit 5f12e3d

Please sign in to comment.