Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
How to display WordPress blog posts on your Rails website
3 Posts
How to display WordPress blog posts on your Rails website

I'm super new to Rails. I've got a spot on my home page where I want to display 2-3 of the most recent posts from my Wordpress account. I found one link to a solution, but the link is dead.

Any help would be greatly appreciated!

Hi Scott,

one solution is to fetch the rss-feed of your blog, parse it and then display it on your site. please have a look at http://rubyrss.com/. there you can find some sample code which does exatly that.

Greets, Sven

Just one line solution found on http://markmcb.com/2008/07/12/ruby-on-rails-rss-reader/
require 'rss'
rss = RSS::Parser.parse(open('http://blog.athlo.com/feed/').read, false).items[0..MaxRSSItems-1]


sorry for formatting
3 Posts
Login to add your message