1//var channels_name='gosdblood', //Ssolo la parte del nombre de mi canal, Ejemplo: --> https://www.youtube.com/user/GoogleDevelopers 2var channels_name='UCpjEq9lmqT-2iVQ2D9Xr7Gw', //Ssolo la parte del id del cananl canal, Ejemplo: --> https://www.youtube.com/user/GoogleDevelopers 3channels_title='Un titulo que quiera mostrar', 4apikey='AIzaSyAPybrsdWkkBMZmEfaWSO4cCwaRHfcW8fs'; 5 6 7$.ajax({ 8 //solicito los datos del canal 9 url: 'https://www.googleapis.com/youtube/v3/channels?part=contentDetails&id=' + channels_name + '&key=' + apikey, 10 crossDomain: true, 11 dataType: 'json' 12}).done(function(a) { 13 var b = a.items[0].contentDetails.relatedPlaylists.uploads, 14 chid = a.items[0].id, 15 nekpag = ''; 16 youtube_video_list_quelees(b, apikey, nekpag, channels_title, chid, channels_name); 17 youtube_video_first_quelees(b, apikey, nekpag, channels_title, chid, channels_name); 18 youtube_video_frontpage_quelees(b, apikey, nekpag, channels_title, chid, channels_name) 19 20 21}); 22 23function youtube_video_list_quelees(f, g, h, j, k, l) { 24 $.ajax({ 25 // linea en donde se define la coneccion con el channel para los parametros tiene que hacerse de acuerdo a la api de youtube ejemplo maxResult 26 url: 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=PLu_R8yqGlgcL3iLHWTkzHJUQYyuwmxksE&key=' + g + '&pageToken=' + h+'&maxResults=6', 27 dataType: 'json' 28 }).done(function(c) { 29 var d = ''; 30 31 // carga la lista de los ultimos videos subidos en el canal 32 // crea el div a llamar 33 34 d+= '<div class="ibacordotcom-vid-bottom">'; 35 36 $.each(c.items, function(i, a) { 37//muestra el ultimo video subido en la pantalla de reproduccion // 38 var b = c.items[i].snippet.resourceId.videoId; 39 var id =i; 40 41 42 43 getwaktu(b, i, g); 44 d += '<div class="col-md-6 col-sm-6 youtube">' 45 46// iframe con tamaños fijos 47 d+='<div class="embed-responsive embed-responsive-16by9">'; 48 d += '<iframe src="http://www.youtube.com/embed/' + b + '?rel=0&showinfo=0" allowfullscreen="true" width:600 height:198 frameborder="0" class="embed-responsive-item"></iframe>'; 49 d+='</div>'; 50 d+='<div class="titulo_youtube">'; 51 d += '<span>'+c.items[i].snippet.title.substring(0, 100) + '...</span style="color:white;">'; 52 d+='</div>'; 53 d += '</div>' 54 55 56 57 }); 58 59 d += '</div>'; 60 61 $('.list_queless').html(d); 62 63 }) 64} 65 66 67function youtube_video_first_quelees(f, g, h, j, k, l) { 68 $.ajax({ 69 // linea en donde se define la coneccion con el channel para los parametros tiene que hacerse de acuerdo a la api de youtube ejemplo maxResult 70 url: 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=PLu_R8yqGlgcL3iLHWTkzHJUQYyuwmxksE&key=' + g + '&pageToken=' + h+'&maxResults=1', 71 dataType: 'json' 72 }).done(function(c) { 73 var d = ''; 74 75 // carga la lista de los ultimos videos subidos en el canal 76 77 // crea el div a llamar 78 d+= '<div class="ibacordotcom-vid-bottom2">'; 79 80 $.each(c.items, function(i, a) { 81 //muestra el ultimo video subido en la pantalla de reproduccion // 82 var b = c.items[i].snippet.resourceId.videoId; 83 84 85 getwaktu(b, i, g); 86 87 d += '<div class="col-md-12 col-sm-12 youtube">' 88 89// iframe con tamaños fijos 90 91 d+='<div class="embed-responsive embed-responsive-16by9">'; 92 d += '<iframe src="http://www.youtube.com/embed/' + b + '?rel=0&showinfo=0" allowfullscreen="true" width:600 height:198 frameborder="0" class="embed-responsive-item"></iframe>'; 93 d+='</div>'; 94 d+='<div class="titulo_youtube">'; 95 d += '<span>'+c.items[i].snippet.title.substring(0, 100) + '...</span style="color:white;">'; 96 d+='</div>'; 97 d += '</div>' 98 }); 99 100 d += '</div>'; 101 $('.first_quelees').html(d); 102 103 }) 104} 105 106function youtube_video_frontpage_quelees(f, g, h, j, k, l) { 107 $.ajax({ 108 // linea en donde se define la coneccion con el channel para los parametros tiene que hacerse de acuerdo a la api de youtube ejemplo maxResult 109 url: 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=PLu_R8yqGlgcL3iLHWTkzHJUQYyuwmxksE&key=' + g + '&pageToken=' + h+'&maxResults=2', 110 dataType: 'json' 111 }).done(function(c) { 112 var d = ''; 113 114 // carga la lista de los ultimos videos subidos en el canal 115 116 // crea el div a llamar 117 d+= '<div class="ibacordotcom-vid-bottom">'; 118 119 $.each(c.items, function(i, a) { 120 //muestra el ultimo video subido en la pantalla de reproduccion // 121 122 var b = c.items[i].snippet.resourceId.videoId; 123 var id =i; 124 125 126 getwaktu(b, i, g); 127 d += '<div class="col-md-6 col-sm-6 youtube" style="padding-bottom:10px">' 128 129// iframe con tamaños fijos 130 131 d+='<div class="embed-responsive embed-responsive-16by9">'; 132 d += '<iframe src="http://www.youtube.com/embed/' + b + '?rel=0&showinfo=0" allowfullscreen="true" width:600 height:198 frameborder="0" class="embed-responsive-item"></iframe>'; 133 d+='</div>'; 134 135 d += '</div>' 136 137 }); 138 139 d += '</div>'; 140 141 142 143 $('.youtube_video_frontpage_quelees').html(d); 144 145 }) 146} 147 148function getwaktu(c, i, g) { 149 $.ajax({ 150 url: 'https://www.googleapis.com/youtube/v3/videos?id=' + c + '&key=' + g + '&part=contentDetails', 151 dataType: 'json' 152 }).done(function(a) { 153 154 var b = a.items[0].contentDetails.duration, 155 dataw = '', 156 menit = '', 157 detik = ''; 158 159 if(b.match(/M/g)){ 160 dataw = b.split('M'); 161 menit = dataw[0].replace('PT',''); 162 if(dataw[1] != ''){ 163 detik = dataw[1].replace('S',''); 164 }else{ 165 detik = '00'; 166 } 167 168 }else{ 169 170 dataw = b.split('PT'); 171 menit = '00'; 172 detik = dataw[1].replace('S',''); 173 174 } 175 176 177 }) 178} 179 180
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.