So, firstly, here's an Atom feed snippet which I am trying to parse:
// http://somelink.com/atom
<feed xmlns="http://www.w3.org/2005/Atom">
<entry>
<title>Title Here</title>
<link href="http://somelink.com/link1&amp;amp;ref=rss" rel="alternate" />
<link href="http://somelink.com/link2&amp;amp;ref=rss" rel="tag:somelink.com/apply_url"/>
...
</entry>
I pull the Atom feed like so,
// In controller index method
@rss = SimpleRSS.parse open('http://somelink.com/atom')
Then I output the response in the view, which I am writing using Haml, as follows:
- @rss.entries.each do |item|
.title-div
= item.title
.title-link
= item.link //outputs the first link
I could run a second loop for the links but is there a way to get the second link without it? Like reading the "rel" attribute and outputting the correct link? How do I do this in Haml/Rails?
EDIT: The gem i am using: http://simple-rss.rubyforge.org/