Skip to content

Commit

Permalink
add in title and were good to go
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Jan 22, 2008
1 parent 564b5ad commit 019d89a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions subtle.rb
Expand Up @@ -156,12 +156,14 @@ def render_svn_feed(item)
end

def render_atom_feed(item)
entries = hEntry.find(item.url)
website = timeout { open(item.url).read }
title = Hpricot(website).at(:title).innerHTML
entries = hEntry.find(:all => { :text => website }, :base => item.url)

if entries.nil? || entries.empty?
erb %(<h3>Error Atomizing #{item.url}!</h3><p>Couldn't find or parse hAtom.</p>)
else
feed = entries.to_atom.strip
feed = entries.to_atom(:title => title).strip
File.open(@file, 'w') { |f| f.puts feed }
xml!
feed
Expand Down

0 comments on commit 019d89a

Please sign in to comment.