<commit_before>
var trackName = document.getElementById('track-name');
var artist = document.getElementById('artist');
var artwork = document.getElementById('artwork');


// SC.stream('/tracks/293', function(sound){
//  play.addEventListener('click', function(e){
//      sound.start();
//  });
//  pause.addEventListener('click', function(e){
//      sound.pause();
//  });
// });

// function mySounds(){
//  SC.connect(function(){
//      SC.get('/me', function(me){
//          alert('Hello, ' + me.username);
//      });
//  });
// }

// mySounds();


// helper function to get user id of specific artist on soundcloud
//takes in a string version of the url appends it to the resolve api reference
// function getId(url) {
//     SC.get('/resolve/?url=' + url, function(result) {
//         console.log(result);
//     });
// }
//getId('https://soundcloud.com/Soulection');


SC.initialize({
    client_id: 'd1406a91a61f2077f85d9e0687a6ad75',
    redirect_uri: 'http://0.0.0.0:8080/redirect.html'
});

//return length of track in miliseconds
function getTrackDuration(track) {
    //console.log(track.duration);
    return track.duration;
}

function getTrackName(track){
    return track.title;
}

function getArtistName(track){
    return track.user.username;
}

function getBackground(track){
    return track.artwork_url;
}

function playMusic(track) {
    var play = document.getElementById('play');
    var pause = document.getElementById('pause');

    SC.stream('/tracks/' + track.id, function(track) {
        play.addEventListener('click', function(e) {
            play.style.visibility = 'hidden';
            pause.style.visibility = 'initial';
            track.play();

        });
        pause.addEventListener('click', function(e) {
            play.style.visibility = 'initial';
            pause.style.visibility = 'hidden';
            track.pause();
        });
    });
}

function dwnld(track){
    if(track.downloadable === true){
        var link = document.createElement('a');
        var linkText = document.createTextNode('Download Now');
        link.appendChild(linkText);
        link.id = 'download';
        link.href = track.download_url;
        return document.body.appendChild(link);
    }else{
        return "";
    }
}

function selectedArtist() {<commit_msg>code documentation<commit_after>
var trackName = document.getElementById('track-name');
var artist = document.getElementById('artist');
var artwork = document.getElementById('artwork');


// SC.stream('/tracks/293', function(sound){
//  play.addEventListener('click', function(e){
//      sound.start();
//  });
//  pause.addEventListener('click', function(e){
//      sound.pause();
//  });
// });

// function mySounds(){
//  SC.connect(function(){
//      SC.get('/me', function(me){
//          alert('Hello, ' + me.username);
//      });
//  });
// }

// mySounds();


// helper function to get user id of specific artist on soundcloud
//takes in a string version of the url appends it to the resolve api reference
// function getId(url) {
//     SC.get('/resolve/?url=' + url, function(result) {
//         console.log(result);
//     });
// }
//getId('https://soundcloud.com/Soulection');


SC.initialize({
    client_id: 'd1406a91a61f2077f85d9e0687a6ad75',
    redirect_uri: 'http://0.0.0.0:8080/redirect.html'
});

//return length of track in miliseconds
function getTrackDuration(track) {
    //console.log(track.duration);
    return track.duration;
}

function getTrackName(track){
    return track.title;
}

function getArtistName(track){
    return track.user.username;
}

function getBackground(track){
    return track.artwork_url;
}

function playMusic(track) {
    var play = document.getElementById('play');
    var pause = document.getElementById('pause');

    SC.stream('/tracks/' + track.id, function(track) {
        play.addEventListener('click', function(e) {
            play.style.visibility = 'hidden';
            pause.style.visibility = 'initial';
            track.play();

        });
        pause.addEventListener('click', function(e) {
            play.style.visibility = 'initial';
            pause.style.visibility = 'hidden';
            track.pause();
        });
    });
}

function dwnld(track){
    if(track.downloadable === true){
        var link = document.createElement('a');
        // creates text in between the opening and closing html tags
        var linkText = document.createTextNode('Download Now');
        link.appendChild(linkText);
        link.id = 'download';
        link.href = track.download_url;
        return document.body.appendChild(link);
    }else{
        return "";
    }
}

function selectedArtist() {
{'fraction_non_alphanumeric': 0.1627509611277232, 'fraction_numerical': 0.014096539940196497, 'mean_word_length': 2.8166259168704157, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2591563', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1356, 'n_words': 279}