aboutsummaryrefslogtreecommitdiff
path: root/assets/js/yt-list-videos.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2019-11-30 12:40:35 -0500
committerAndrew Lee <alee14498@protonmail.com>2019-11-30 12:40:35 -0500
commite706e65318f760d9f0602a08f1badb67d77e5fb1 (patch)
treef013b09cab3064a51fe5439cb98e24eace15224e /assets/js/yt-list-videos.js
parentb99356105115fec32d75a43bfb5b054220d90141 (diff)
downloadalp-website-e706e65318f760d9f0602a08f1badb67d77e5fb1.tar.gz
alp-website-e706e65318f760d9f0602a08f1badb67d77e5fb1.tar.bz2
alp-website-e706e65318f760d9f0602a08f1badb67d77e5fb1.zip
Switching to NextJS
Diffstat (limited to 'assets/js/yt-list-videos.js')
-rw-r--r--assets/js/yt-list-videos.js44
1 files changed, 0 insertions, 44 deletions
diff --git a/assets/js/yt-list-videos.js b/assets/js/yt-list-videos.js
deleted file mode 100644
index 8e0f395..0000000
--- a/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