google.load("feeds", "1"); String.prototype.left = function(n) { if (n <= 0) return ""; else if (n > String(this).length) return this; else return String(this).substring(0,n) + "..."; } function initialize() { var feed = new //google.feeds.Feed("http://confluence.webalive.biz/createrssfeed.action?types=page&types=blogpost&sort=created&spaces=KB&labelString=tips&rssType=rss2&maxResults=999&timeSpan=999&publicFeed=false&title=Tips"); google.feeds.Feed("https://confluence.webalive.biz/createrssfeed.action?types=page&types=blogpost&sort=created&showContent=true&spaces=KB&labelString=tips&rssType=atom&maxResults=10&timeSpan=999&publicFeed=true&title=Tips"); feed.setNumEntries(1); feed.load(function(result) { if (!result.error) { var container = document.getElementById("feed-tips"); container.style.paddingLeft = "5"; container.style.marginLeft = "5"; for (var i = 0; i < result.feed.entries.length; i++) { var entry = result.feed.entries[i]; var item = document.createElement("li"); var link = document.createElement("a"); var pubdate = document.createElement("small"); var content = document.createElement("div"); item.style.listStyleType = "none"; item.style.marginBottom = "10px"; pubdate.appendChild(document.createTextNode(entry.publishedDate.left(12))); //pubdate.style.fontSize = "90%"; content.innerHTML = entry.content; link.href = entry.link; link.title = entry.title.replace(/\(updated\)/,""); // link.title = link.title.replace(/\(created\)/,""); if( link.title.length > 37 ) { link.title = link.title.left(37) + '...'; } // link.appendChild(pubdate); link.appendChild(document.createElement("br")); link.appendChild(document.createTextNode(link.title)); item.appendChild( link ); //var content2 = unescape(content); //var appendedContent = item.appendChild(content2); var appendedContent = item.appendChild(content); //appendedContent.firstChild.removeChild(appendedContent.firstChild.getElementsByTagName("div")[0]); appendedContent.removeChild(appendedContent.getElementsByTagName("p")[0]); //appendedContent.firstChild.removeChild(appendedContent.firstChild.getElementsByTagName("p")[0]); // appendedContent.firstChild.innerHTML = // appendedContent.firstChild.innerHTML.replace(/(<([^>]+)>)/ig,""); // appendedContent.firstChild.innerHTML = // appendedContent.firstChild.innerHTML.left(276) + '...'; //appendedContent.innerHTML = //appendedContent.innerHTML.replace(/(<([^>]+)>)/ig,""); appendedContent.innerHTML = appendedContent.innerHTML.replace(/(<([^>]+)>)/ig,""); appendedContent.innerHTML = appendedContent.innerHTML.left(276) + '...'; container.appendChild(item); } } }); } google.setOnLoadCallback(initialize);