Showing Google Reader Feeds on a WordPress Sidebar

Google Reader has some great tagging and sharing features.  You can easily get an Atom feed of those stories that you have tagged with a particular tag – this is a great way to keep a public ‘current reading’ list.  It wasn’t as easy as I had thought it would be to get this feed up on my WordPress blog, but I found a way.  Hopefully the below will be helpful to anyone trying to do the same.

The feed, with concatinated titles

The feed, with concatenated titles

The Problem:

WordPress uses the Magpie RSS parser to parse feeds. This is true for the built in RSS widget and also the advanced KBRSS widget. Magpie has some limitations that are highlighted by Google’s feeds. In particular Magpie has a nasty habit of taking multiple <link> tags and squishing them into one, and doing the same with multiple <title> tags. Very bad behavior for a parser. Without any additional treatment, WordPress digests Google Reader links like the picture at right.

The Solution

I’ll cut out some of the wrong turns along the way.  This post, from EconTech, solves a parallel problem and gave me the key to fixing this one.  We need to scrub the feed before we send it over to WordPress.  He used Feedburner to clean it up and translate it to RSS, than let WordPress and Magpie digests the RSS that Feedburner spits out.

The Step-by-Step

  1. Get your Google Reader Feed URL (Settings -> Folders and Tags -> View Public Page -> Get the feed from your browser)
  2. Set up a Feedburner feed using the URL from step 1
  3. On the Feedburner feed, deactivate Browser Friendly and Smart Feed (under the Optimize tab)
  4. Still on the Feedburner feed, activate Convert Format using RSS 2.0.
  5. Note the URL of the feedburner feed
  6. Use that one to populate your RSS widget in WordPress

 

Bonus Points

  • I assume that the default WordPress RSS widget works, but I didn’t try it.  Part of what I like about Google Reader is the ability to add notes to the items you share, and I wanted to make sure those got fed in.  So I’m using the kbrss plugin.  You can follow the instructions to set that guy up – it’s pretty straightforward.  I use a template along these lines to get the fields I want:

<li><span class=’reading-date’>^pubdate[opts:date=F jS Y]$</span><br/>
<a class=’reading-link’ href=’^link$’ title=’^title$’>^title$</a><br/>
<span class=’reading-annot’>^gr=>annotation_content$</span></li>

  • If you get deeper into kbrss, you’ll probably want to use the ?kbrss=feed_url option to take a look at how WordPress reads your feed.  On my setup, I had to encode my feed url before this option would work.  Probably some sort of security issue.  Here’s a string encoder.

 

Missing Pieces

What’s left out of this solution is those second and third links and titles that were in the original feed.  In particularly, the title of the blog that the story originally came from doesn’t get carried through.  If you want to take up the charge, that’s something that should be picked up in a more robust solution.

17 thoughts on “Showing Google Reader Feeds on a WordPress Sidebar

  1. Pingback: RSS Feeds Working in Blog « augustjackson dot net

  2. One note, I realized the links and title’s weren’t showing up correctly when I used the template to display my comments in the widget. I fixed it by changing all the apostrophes(‘) to quotes(“) and it worked like a charm.

  3. I just had a hiccup with this today. Without my making any changes to Reader, Feedburner, or my blog, the sidebar feed started to look funny. It was showing post titles and originating blogs (huh?) and not showing my comments. I started digging into the problem, but after checking feedburner to see if anything went wrong, the problem just went away. Hmm…

  4. Pingback: Emin Şenay - Blog » Site Arayüzü ve Birtakım Değişiklikler 2

  5. I love my Google Reader and have tried a few ways to include some of my public feeds in wordpress, but have found a lot of frustration. I wasn’t able to get feeburner to fix things either.

    The only solution I have found that fully translates the Google RSS, complete with the links to original articles and all is to pass it through Yahoo Pipes, then Feed WordPress plugin.

    That also offers some interesting possibilities for combining new feeds, adding flickr feeds and even further filtering. Or just add the one feed and use the new Yahoo feed to bring into wordpress.

    In wordpress I like the FeedWordpress plugin.

    Wp-O-Matic killed my site, spiraling out of control! I had to call my hosting company and have them kill the process. In just a few minutes it posted hundreds of posts from a feed with 8 posts total!

    Or if you just want titles, find the Simplepie Plugin – Works great.

  6. Pingback: Added my Google Reader Widget - what_i_am.upto(2009)

  7. hi,
    i am totaly new in wordpress and i do not understand the last point:
    6. Use that one to populate your RSS widget in WordPress

    what exactly should i do?
    thanks a lot!

  8. The URL noted in step 5 is the one to put in as the source URL for the RSS widget. (Exactly where that goes, I’ll tell you the truth, I don’t remember, and it’s not immediately obvious to me on a very quick look at my settings over here.)

Leave a Reply