Skip to content

Instantly share code, notes, and snippets.

@tacoman667
Created September 7, 2012 16:35
Show Gist options
  • Save tacoman667/3667625 to your computer and use it in GitHub Desktop.
Save tacoman667/3667625 to your computer and use it in GitHub Desktop.
what the...
def index
@asset = Slide.active.order("position")
url = 'http://www.example.com/feed'
open(url) do |rss|
rss_feed = RSS::Parser.parse(rss)
rss_feed.items.first do |item|
logger.info item
@feed = BlogFeed.new(title: item.title, link: item.link, date: item.pubDate, author: item.author, description: item.description)
end
end
begin
@weeklymessage = WeeklyMessage.find(1)
rescue ActiveRecord::RecordNotFound
@weeklymessage = WeeklyMessage.new
end
render :layout => 'home'
end
<div class="row-fluid">
<div class="span12">
<div class="featured-blog">
<div class="row">
<div class="span7 offset5 blogz">
<h2><%= @feed.title %></h2>
<p><%= @feed.description %></p>
<p class="author">Most recent post from <%= @feed.author %> / <%= @feed.date.to_date.strftime('%m.%d.%y') %></p>
<a class="blog-link" href="<%= @feed.link %>">Continue Reading</a>
</div>
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment