-
Notifications
You must be signed in to change notification settings - Fork 0
/
feed.js
23 lines (21 loc) · 824 Bytes
/
feed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
google.load("feeds", "1");
function initialize() {
var feed = new google.feeds.Feed("http://gdata.youtube.com/feeds/api/users/vsauce/uploads");
feed.setNumEntries(10);
var count = 1;
feed.load(function(result) {
if (!result.error) {
var container = document.getElementById("feed");
var html = "";
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
html = "<h5>" + count++ + ". <a href='" + entry.link + "'>" + entry.title + "</a></h5>";
var div = document.createElement("div");
div.innerHTML = html;
container.appendChild(div);
}
document.write(html);
}
});
}
google.setOnLoadCallback(initialize);