January 25th 2009
WP Google Reader Plugin
1. Introduction
Google Reader is a web-based RSS aggregator. One of it’s many features allows you to share items with other web users, and these shared items are available as an ATOM feed.
This WordPress plugin allows you to emebed your shared item on Google Reader into a post or page on you site. I ended up writting this plugin after failing to find any other RSS plugins that worked with Google Reader.
| File Title: | wp-googlereader-1.0.zip |
|---|---|
| File Size: | 1.6 Kb |
2. Installing
Simply unzip wp-googlereader-1.0.zip into your wp-content/plugins directory and activate it in the Plugins page on the WordPress admin interface.
NOTE: WordPress uses MagpieRSS which only has limited support for ATOM feeds. When parsing the Google Reader feed it manages to combine both the item title and the source title together. To fix this a small modification needs to be made to wp-includes/rss.php:
Change this line:
var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
to this:
var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'tagline', 'copyright');
This information came from this post on the WordPress forums: http://wordpress.org/support/topic/164824?replies=4#post-725697
3. Usage
To embed your shared Google Reader items simply add the following line to a page or post:
[google_reader]01234567890123456789[/google_reader]
Replace 01234567890123456789 with your Google Reader user number. You can find this by logging into Google Reader and clicking on Shared Items. Your Google Reader number appears as part of the URL in the address bar of your web browser:
http://www.google.com/reader/view/#stream/user%2F01234567890123456789%2Fstate%2Fcom.google%2Fbroadcast
Each shared item is embedded in the page as follows:
<div class="google_reader_item">
<h3><a href="http://www.example.com/">Example: A Story</a></h3>
<div class="google_reader_item_info"><p>via <a href="http://www.example.com/">Example</a> by Joe Blogs on 2009-01-01</p></div>
<div class="google_reader_item_content">blah blah blah</div>
</div>
You can use CSS to style each of the items, e.g:
div.google_reader_item {
-moz-border-radius-bottomleft : 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-topleft : 5px;
-moz-border-radius-topright : 5px;
border : 1px solid #bbbbbb;
overflow : hidden;
max-width : 800px;
padding : 0.5em;
margin-bottom : 2em;
}
div.google_reader_item h3 {
margin-top : 0em;
}
div.google_reader_item_info p {
color : #999999;
font-size : 90%;
font-style : italic;
margin-top : 0em;
}
div.google_reader_item_content {
text-align : justify;
}








