<commit_before>var tweetList;

var count = 0;

var appendTweet = function(tweet){
    count = count + 1;
    var list = $('#list');
    list.prepend("<li>" + tweet["text"] + "</li>");
    if (count > 30){
      $('#list li:last-child').remove();
    }
};

// -------------- Maps -------------------------
var map;

var initGoogleMap = function() {
    mapOptions={
        scrollwheel: true,
        navigationControl: true,
        mapTypeControl: true,
        scaleControl: true,
        draggable: true,
        center: new google.maps.LatLng(20.7127,-30.0059),
        zoom: 3
    };

    map = new google.maps.Map(document.getElementById("map-canvas"),
        mapOptions);
}

function loadGoogleMapScript() {
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'https://maps.googleapis.com/maps/api/js?sensv=3.exp&sensor=true&' +
        'callback=initGoogleMap&libraries=visualization';
    document.body.appendChild(script);
};


var iconBase = '/assets/';
var iconTweet = iconBase + 'tweet__.png'; 

var pushHeatMarkers = function(lat_lon_array, text) {
    var markers =[];

    $(lat_lon_array).each(function(i, marker){
        var lat_lon =  new google.maps.LatLng(marker[0],marker[1]);

        new google.maps.Marker({
            position: lat_lon,
            map: map,
            title: text,
            icon: iconTweet,
            animation: google.maps.Animation.DROP
        });
    });
};

var appendToHeatMap = function (tweets) {
    var geo;
    geo = tweets["geo"]["coordinates"];
    pushHeatMarkers([geo], tweets["text"]);
}

window.onload = loadGoogleMapScript;
//-------------------------------------------

$(document).ready(function(){

    var dispatcher = new WebSocketRails('localhost:3000/websocket');
    var channel = dispatcher.subscribe('tweets');
    console.log(channel);
<commit_msg>tweets and styling<commit_after>var tweetList;

var count = 0;

var appendTweet = function(tweet){
    count = count + 1;
    var list = $('#list');
    list.prepend("<li>" + tweet["text"] + "</li>");
    if (count > 30){
      $('#list li:last-child').remove();
    }
};

// -------------- Maps -------------------------
var map;

var initGoogleMap = function() {
    mapOptions={
        scrollwheel: true,
        navigationControl: true,
        mapTypeControl: true,
        scaleControl: true,
        draggable: true,
        center: new google.maps.LatLng(20.7127,-30.0059),
        zoom: 3
    };

    map = new google.maps.Map(document.getElementById("map-canvas"),
        mapOptions);
        
}

function loadGoogleMapScript() {
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'https://maps.googleapis.com/maps/api/js?sensv=3.exp&sensor=true&' +
        'callback=initGoogleMap&libraries=visualization';
    document.body.appendChild(script);
};


var iconBase = '/assets/';
var iconTweet = iconBase + 'tweet__.png'; 

var pushHeatMarker = function(lat_lon_array, tweet) {
    var markers =[];

    $(lat_lon_array).each(function(i, marker){
        var lat_lon =  new google.maps.LatLng(marker[0],marker[1]);

      var contentString = '<div id="content" class="tweetMarker" style="max-width: 400px;">'+
          '<img style="float: left; border-radius: 4px; margin-right: 6px; width: 60px;" src="' + 
          tweet["user"]["profile_image_url"] +
          '">' + 
          '<div style="float: left; max-width: 300px;">' + 
          '<b>' + tweet["user"]["name"] + '</b>' +
          ' <span style="color: #8899a6">@' + tweet["user"]["screen_name"] + '</span><br>' +
          tweet["text"] +
          '</div>' +
          '</div>';
          
        var infowindow = new google.maps.InfoWindow({
            content: contentString
        });

        var marker = new google.maps.Marker({
            position: lat_lon,
            map: map,
            title: tweet["text"],
            icon: iconTweet,
            animation: google.maps.Animation.DROP
        });
        
        google.maps.event.addListener(marker, 'click', function() {
          $(".tweetMarker").parent().parent().parent().fadeOut();
          infowindow.open(map, marker);
        });

    });
};

var appendToHeatMap = function (tweet) {
    var geo;
    geo = tweet["geo"]["coordinates"];
    pushHeatMarker([geo], tweet);
}

window.onload = loadGoogleMapScript;
//-------------------------------------------

$(document).ready(function(){

    var dispatcher = new WebSocketRails('localhost:3000/websocket');
    var channel = dispatcher.subscribe('tweets');
    console.log(channel);

{'fraction_non_alphanumeric': 0.19295592048401036, 'fraction_numerical': 0.013612791702679343, 'mean_word_length': 2.368995633187773, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '3845298', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1396, 'n_words': 272}