-
Notifications
You must be signed in to change notification settings - Fork 0
/
channel1.js
36 lines (31 loc) · 1.06 KB
/
channel1.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function channel1 (youtubeChannelID) {
options.channelId= youtubeChannelID;
loadVids();
function loadVids() {
$.getJSON(URL, options, function (data) {
var id = data.items[0].id.videoId;
resultsLoop(data);
});
function resultsLoop(data) {
$.each(data.items, function (i, item) {
var thumb = item.snippet.thumbnails.medium.url;
var title = item.snippet.title;
var desc = item.snippet.description.substring(0, 100);
var vid = item.id.videoId;
var titleTags = cryptosArr.filter(function(val){
return title.includes(val);
});
obj = {
"thumb": item.snippet.thumbnails.medium.url,
"title": item.snippet.title,
"desc": item.snippet.description.substring(0, 100),
"vid": item.id.videoId,
"channelTitle": item.snippet.channelTitle,
"tags": titleTags
}
arr.push(obj);
return thumb, title, desc, vid;
});
}
}
}