<commit_before>function getUsersPlaylist(channel) {
    var data = {
        part        : 'contentDetails', 
        forUsername : channel,
        key         : '<KEY>',
    };

    superagent
    .get('https://www.googleapis.com/youtube/v3/channels')
    .query(data)
    .set('Accept', 'application/json')
    .end(function(err, res) {
        if (err || !res.ok) {
            alert('Oh no! error');
        } else {
            res.body.items.forEach(function(item, i) {
               var pid = item.contentDetails.relatedPlaylists.uploads
               getUsersVideos(pid);
            });
        }
    });
}

function getUsersVideos(pid) {
    var data = {
        part       : 'snippet', 
        maxResults : 10,
        playlistId : pid,
        key        : '<KEY>',
        order      : 'date'
    };

    superagent
    .get('https://www.googleapis.com/youtube/v3/playlistItems')
    .query(data)
    .set('Accept', 'application/json')
    .end(function(err, res) {
        if (err || !res.ok) {
            alert('Oh no! error');
        } else {
            res.body.items.forEach(function(video, i) {
                var html = '<div class="video"> \
                    <a href="https://youtube.com/watch?v=' + video.snippet.resourceId.videoId + '" class="title">\
                    <img src="http://img.youtube.com/vi/' + video.snippet.resourceId.videoId + '/maxresdefault.jpg">' + 
                    video.snippet.title + '</a> \
                </div>';
                document.querySelector('.videos').innerHTML += html;
            });
        }
    });
}
getUsersPlaylist('testedcom');<commit_msg>007 - Little fix: Remove „http(s)“ from resources<commit_after>function getUsersPlaylist(channel) {
    var data = {
        part        : 'contentDetails', 
        forUsername : channel,
        key         : '<KEY>',
    };

    superagent
    .get('https://www.googleapis.com/youtube/v3/channels')
    .query(data)
    .set('Accept', 'application/json')
    .end(function(err, res) {
        if (err || !res.ok) {
            alert('Oh no! error');
        } else {
            res.body.items.forEach(function(item, i) {
               var pid = item.contentDetails.relatedPlaylists.uploads
               getUsersVideos(pid);
            });
        }
    });
}

function getUsersVideos(pid) {
    var data = {
        part       : 'snippet', 
        maxResults : 10,
        playlistId : pid,
        key        : '<KEY>',
        order      : 'date'
    };

    superagent
    .get('https://www.googleapis.com/youtube/v3/playlistItems')
    .query(data)
    .set('Accept', 'application/json')
    .end(function(err, res) {
        if (err || !res.ok) {
            alert('Oh no! error');
        } else {
            res.body.items.forEach(function(video, i) {
                var html = '<div class="video"> \
                    <a href="//youtube.com/watch?v=' + video.snippet.resourceId.videoId + '" class="title">\
                    <img src="//img.youtube.com/vi/' + video.snippet.resourceId.videoId + '/maxresdefault.jpg">' + 
                    video.snippet.title + '</a> \
                </div>';
                document.querySelector('.videos').innerHTML += html;
            });
        }
    });
}
getUsersPlaylist('testedcom');
{'fraction_non_alphanumeric': 0.15900091379835515, 'fraction_numerical': 0.003350593968930856, 'mean_word_length': 1.6591093117408906, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 5, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4315053', 'n_tokens_mistral': 1008, 'n_tokens_neox': 971, 'n_words': 161}