We need to leverage new technology, don’t we? I volunteered to create an aggregated Young Leaders Forum Fellow Blog
Feed. The URL of this feed is
http://tinyurl.com/2zc4vz
. There are some behind the scene works.
- I get a list of all
YLF fellow (the listing is still growing) and put all the blog entries together.
- I sort the blog entries according to published time so the latest one is always on the top
- I have limited my blog RSS output to only the articles with YLF or Young Leaders Forum in it, to avoid
overwhelm people with not related comments. Remember, I write daily
- I am still trying to add a “Translate this” button to the beginning of the description section of Chinese entries so
our American Fellows can at least have some idea about what the entries are about. This is not completed yet
In case you want to trace the latest thoughts of YLF, please subscribe to this feed or simply check out this page.
function BlogPreview(container) {
this.container_ = container;
}
BlogPreview.prototype.show = function(url, opt_noTitle) {
var feed = new google.feeds.Feed(url);
feed.setNumEntries(20);
var preview = this;
feed.load(function(result) {
preview.render_(result, opt_noTitle);
});
}
BlogPreview.prototype.render_ = function(result, opt_noTitle) {
if (!result.feed || !result.feed.entries) return;
while (this.container_.firstChild) {
this.container_.removeChild(this.container_.firstChild);
}
var blog = this.createDiv_(this.container_, "blog");
if (!opt_noTitle) {
var header = this.createElement_("h2", blog, "");
this.createLink_(header, result.feed.link, result.feed.title);
}
for (var i = 0; i < result.feed.entries.length; i++) { var entry = result.feed.entries[i]; var div = this.createDiv_(blog, "entry"); var linkDiv = this.createDiv_(div, "title1"); this.createLink_(linkDiv, entry.link, entry.title); if (entry.author) { this.createDiv_(div, "author", "Posted by " + entry.author); } this.createDiv_(div, "body", entry.contentSnippet); } } BlogPreview.prototype.createDiv_ = function(parent, className, opt_text) { return this.createElement_("div", parent, className, opt_text); } BlogPreview.prototype.createLink_ = function(parent, href, text) { var link = this.createElement_("a", parent, "", text); link.href = href; return link; } BlogPreview.prototype.createElement_ = function(tagName, parent, className, opt_text) { var div = document.createElement(tagName); div.className = className; parent.appendChild(div); if (opt_text) { var e = document.createElement('span'); e.innerHTML = opt_text; div.appendChild(e); } return div; }
google.load("feeds", "1");
function executeSearch() {
var url = document.getElementById("urltextbox");
if (!url.value) {
url.focus();
return false;
}
var blog = new BlogPreview(document.getElementById("blog"));
blog.show(url.value);
return false;
}
function initialize() {
var url = document.getElementById("urltextbox");
url.value = "http://pipes.yahoo.com/pipes/pipe.run?_id=1hmChtSk3BGXvFZW8ivLAg&_render=rss";
executeSearch();
}
google.setOnLoadCallback(initialize);