Adding Google Reader Notes to a WordPress Blog

by aakar on November 26, 2008

I took the opportunity this week to implement auto-posting from Google Reader to WordPress. I spend an excessive amount of my time online in Google Reader, mostly catching up on all the latest blogs and news. The ability to share items or add a note to shared items is really quite easy and thus my ‘Google Reader Shared Items‘ feed is updated regularly. As a result, I thought it may be advantageous to take the items I share with notes and add them to the blog. It took some time to determine the best method to implement the posts from my shared items to my blog and it still is far from perfect. As such, in the coming weeks I will continue to update and tweak the method and how the post itself looks.

The most notable and major issue that arose during determining how to do this was ‘How to share only items that I have added a note to?’ While the ‘Shared Items‘ have one feed, each tag can also have an individual feed, but items with a note aren’t broke down into their individual feed. Thus, I decided that the feed needed to be manipulated and to do this I used Yahoo Pipes to manipulate the feed. I essentially created a pipe that would take my ‘Shared Items‘ feed and filter out items that did not contain ‘text’ within the content element under ‘item.gr:annotation.content.content’. The pipe then loops through the filtered content placing ‘blockquotes’ around the content and not my comments. That final loop was just for display purposes.

To implement the output as a post in WordPress I used the ‘wp-o-matic‘ plug-in. This plug-in lets you create a campaign, which will check an RSS feed for updates (using a variety of methods) and then create individual posts. The plug-in does have the ability to configure how the post is displayed in a variety of ways. However, there is one issue with the current version, the plug-in does not fetch any items in a Yahoo Pipes feed or any feed with an ‘&’ in the URL. Currently, any URL that contains an ampersand will have the ampersand get converted to its encoded URL value, so an ‘&’ will get converted to ‘&’. To fix this: In the wp_campaign_feeds table in your WordPress database find the erroneous URL and update the ‘&’ to ‘&’ and you should be all set.

As I said above, I will be continuing to tweak this as time permits.