Stuck... have a question...

Stuck... have a question...

  1. ///////////////////////////
  2. // Enter your info below//
  3. /////////////////////////

  4. var channelName = 'thedallascowboyshow';
  5. var vidWidth = 500;
  6. var vidHeight = 400;
  7. var maxResults = 10;
  8. var key = 'TEST KEY';

  9. //////////////////////////////
  10. // NO edit below this line //
  11. ////////////////////////////
  12. $(document).ready (function(){
  13. $.get (
  14.   "https://www.googleapis.com/youtube/v3/channels",{
  15.   part: 'contentDetails',
  16.   forUsername: channelName,
  17.   key: key},
  18.   function(data){
  19.   $.each(data.items, function(i, item){
  20.   console.log(item);
  21.   pid = item.contentDetails.relatedPlaylists.uploads;
  22.   getVids(pid);
  23.   })
  24. }
  25. );
  26. function getVids(pid){
  27. $.get (
  28.   "https://www.googleapis.com/youtube/v3/playlistItems",{
  29.   part: 'snippet',
  30.   maxResults: maxResults,
  31.   playlistId: pid,
  32.   key: key},
  33.   function(data){
  34.   var output;
  35.   var date;
  36.   $.each(data.items, function(i, item){
  37.   console.log(item);
  38.   dateId = item.snippet.publishedAt;
  39.   videoId = item.snippet.resourceId.videoId;
  40.  
  41. output = '<li><iframe height="'+vidHeight+'" width="'+vidWidth+'" src=\"//www.youtube.com/embed/'+videoId+'\" allowfullscreen="true"></iframe></li>';
  42. date='<li>"'+dateId+'"</;i>';
  43.            
  44.   //Append to results listStyleType
  45.   $('#results').append(output);
  46.                                 $('#date').append(date);
  47.   })
  48. }
  49. );
  50. }
  51. });


So far this is what I have... I'm new to all this so I'm stuck... I have the output on line 44 working on the page with no problem....
This is a down and dirty js file I got off of youtube.. believe me if I could figure out how to do this in php I'd rather but... 

I'm trying to show the date line 45.. but I'm getting no output... suggetions?  :)