Customize Google Reader Clip

Adding and customizing Google Reader shared items to your homepage

Add the container

<div id="container" style="border-style: solid;
                           border-width: 1px;
                           background: #E0E0F0;
                           margin-bottom: 0.5em; "></div>

<p>

Write the callback function

<script type="text/javascript">
function buildContent (blog) {
//for (i in blog) { document.write(i + "\n"); };
if (!blog || !blog.items) return;
var container=document.getElementById("container");
var code="<p><ul>";
for (var i = 0; i < blog.items.length; i++) {
  var item = blog.items[i];
  code = code + "<li><a href='"+item.alternate.href+"' title='" +
         item.summary + "'>" +
         item.title + "</a><div>" +

         "from <a href=\"" + item.origin.htmlUrl + "\">" +
         item.origin.title + "</a></div></li>";
}
code = code + "</ul></p><p style='margin-right: 1em; margin-bottom: 0em;' align='right'><a href='http://www.google.com/reader/shared/user/11037445891159098549/state/com.google/broadcast?c=" + blog.continuation + "'>Read other shared items</a></p>";

container.innerHTML=code;
}
</script>

Enable the clip

<script type="text/javascript"
src="http://www.google.com/reader/ui/publisher-en.js"></script>

<script type="text/javascript"
src="http://www.google.com/reader/public/javascript/user/11037445891159098549/state/com.google/broadcast?n=5&callback=buildContent">
</script>

You'll need to replace the user ID with yours, which you can find by clicking on "Your shared items" in the Google Reader left sidebar.


sub-sahara africa
subrahaman
sahara trip IanKnot rainbow