// To display this on a web page, use <div id="stoppress"/>
// You need to declare the Google API key before calling this script

if (typeof google!="undefined") { 
	google.load("feeds", "1");
}

function initialize() {

  var container = document.getElementById("stoppress");
  var feed = new google.feeds.Feed("http://blog.ctc-cambridge.org.uk/feeds/posts/default/-/stoppress?alt=rss");
  
  feed.setNumEntries(4);  
        
  feed.load(function(result) {
     if (!result.error) {
         for (var i = 0; i < result.feed.entries.length; i++) {
         	
        	var entry = result.feed.entries[i];
        	var div1 = document.createElement("div");
        	div1.innerHTML = "<h2><b>"+entry["title"]+"</h2>";     
        	container.appendChild(div1);

        	var div2 = document.createElement("div");
        	div2.innerHTML = "<p>"+entry.content;   
        	container.appendChild(div2);
        }
     }
   });

}

if (typeof google!="undefined") { 
	google.setOnLoadCallback(initialize);
}
