Young Leaders Forum Fellow Blog Feed

By Jian Shuo Wang on 2007-12-09 23:29 · YLF

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.

YLF fellow (the listing is still growing) and put all the blog entries together.

overwhelm people with not related comments. Remember, I write daily

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);

.blog h2 a, .blog h2 a:visited {

text-decoration: none;

color: black;

}

.blog .entry {

margin-bottom: 1.5em;

}

.blog .title {

font-size: medium;

}

.blog .author {

color: gray;

margin-bottom: 0.5em;

}

Reading….