Team:UCLondon/Templates/Navigationv3
From 2012e.igem.org
(Difference between revisions)
Line 343: | Line 343: | ||
/* YOUTUBE CRAP */ | /* YOUTUBE CRAP */ | ||
- | + | ||
function loadPlaylist(){ | function loadPlaylist(){ | ||
$('#yt').html(''); | $('#yt').html(''); | ||
Line 350: | Line 350: | ||
$.getJSON(playListURL, function(data) { | $.getJSON(playListURL, function(data) { | ||
- | + | var list_data=""; | |
- | + | $.each(data.feed.entry, function(i, item) { | |
- | + | var feedTitle = item.title.$t; | |
- | + | var feedURL = item.link[1].href; | |
- | + | var fragments = feedURL.split("/"); | |
- | + | var videoID = fragments[fragments.length - 2]; | |
- | + | var url = videoURL + videoID; | |
- | + | var thumb = "http://img.youtube.com/vi/"+ videoID +"/default.jpg"; | |
- | + | list_data += '<li><a href="'+ url +'" title="'+ feedTitle +'"><img alt="'+ feedTitle+'" src="'+ thumb +'"</a></li>'; | |
- | + | }); | |
$(list_data).appendTo("#yt"); | $(list_data).appendTo("#yt"); | ||
}); | }); | ||
- | |||
} | } | ||
- | + | ||
/* TWITTER CRAP */ | /* TWITTER CRAP */ | ||
Line 421: | Line 420: | ||
loadLatestTweet(); | loadLatestTweet(); | ||
- | + | loadPlaylist(); | |
}); | }); |
Revision as of 20:32, 14 October 2012