diff options
| author | Andrew Lee <alee14498@gmail.com> | 2020-08-27 22:40:07 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@gmail.com> | 2020-08-27 22:40:07 -0400 |
| commit | b754157713b79024793c3571f2dba8c688851796 (patch) | |
| tree | 2a865d281b65c10d3175ccca28587a2d57c50e46 /public/assets/js/yt-list-videos.js | |
| parent | 589e271352fc86c119096e503d799c1a656bbce2 (diff) | |
| download | alp-website-rewrite.tar.gz alp-website-rewrite.tar.bz2 alp-website-rewrite.zip | |
Inital rewriterewrite
Diffstat (limited to 'public/assets/js/yt-list-videos.js')
| -rw-r--r-- | public/assets/js/yt-list-videos.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/public/assets/js/yt-list-videos.js b/public/assets/js/yt-list-videos.js deleted file mode 100644 index 8e0f395..0000000 --- a/public/assets/js/yt-list-videos.js +++ /dev/null @@ -1,44 +0,0 @@ - - -let channelID = 'UCNRn4YDPCCWSEl3CT7eWorA'; -let apiKey = "nope"; // Note to self: Rewrite the authentication part -let vidHeight = 400; -let vidWidth = 500; -let vidMaxResult = 5; - -$(document).ready(function () { - $.get("https://www.googleapis.com/youtube/v3/channels", { - part: 'contentDetails', - id: channelID, - key: apiKey //Browser API Key - }, - function (data) { - $.each(data.items, function (i, item) { - console.log(item); // See in Browser Console - pid = item.contentDetails.relatedPlaylists.uploads; - getVideos(pid); - }) - } - ); - function getVideos(pid) - { - $.get("https://www.googleapis.com/youtube/v3/playlistItems", { - part: 'snippet', - maxResults: vidMaxResult, - playlistId: pid, - key: apiKey //Browser API Key - }, - function (data) { - let outputVideo; - $.each(data.items, function (i, item) { - console.log(item); // See in Browser Console - vidId = item.snippet.resourceId.videoId; - outputVideo = '<li class="yt-vid-list"><iframe height="' + vidHeight + '" width="' + vidWidth + '" src=\"//www.youtube.com/embed/' + vidId + '"> </iframe></li>'; - - //Append to result list - $('#yt-results').append(outputVideo); - }) - } - ); - } -});
\ No newline at end of file |
