Skip to content

Instantly share code, notes, and snippets.

@TianRB
TianRB / get-latest-videos.js
Created March 20, 2019 17:17 — forked from AmmarCodes/get-latest-videos.js
Get the latest videos from a YouTube channel with jQuery.
function show_my_videos(data){
html = ['<ul id="videos">'];
$(data.data.items).each(function(item) {
id = item.id;
description = item.title;
html.push('<iframe width="560" height="315" src="//www.youtube.com/embed/'+ id +'" frameborder="0" allowfullscreen></iframe>');
});
$("#videos").html(html.join(''));
}
// Replace [YOUTUBE_CHANNEL] with the channel you want