Google Reader Shared Items in WP RSS Widget

22 May

I just added a default RSS widget to one of my sidebars and noticed that the links weren’t functioning correctly. The source of the RSS feed is my google reader shared items and I think the format in which google sends the information is different than a normal RSS feed? I don’t know enough about them to be sure. All I know is that for some reason the link to the articles and the link to the sources of the articles are being concatenated together in the widget links.

Here’s a small 2-line fix I came up with if you’re familiar with php and the wordpress framework (version 2.5+).

In your {wp home}/wp-includes/widgets.php find the function wp_widget_rss_output(…). The first foreach() loop in the function should be foreach ($rss->items as $item ) { … Directly after the open curly brace, place these two lines of code:

$parts = explode(‘http’,$item['link']);
$item['link'] = ‘http’.$parts[1];

Voila – that fixed the problem for me. All it does is explode the link string by the delimeter ‘http’ and rebuild the link using the first part. It’s not a very extensible solution though, so I would only use it if you just want to use a google reader shared items feed for the source of an RSS widget.

  • hey bro.. thkx for the tips. I think for sum server u have to use double quote instead of single

    "http" instead of 'http' :)

    works for me too!
  • hey no problem. Though, since writing this I have moved to the FriendFeed activity widget, which I like a lot better: http://wordpress.org/extend/plugins/friendfeed-...

    It includes your google reader shared items as well as other activities
blog comments powered by Disqus