<commit_before>
  command: 'curl -s "http://legacy.cafebonappetit.com/api/2/menus?cafe=261"',
  refreshFrequency: 6000000,



  render: function(output) {
    return [
        '<select class="myDiet">',
        '  <option value="-1">All</option>',
        '  <option value="6">Farm to Fork</option>',
        '  <option value="18">Humane</option>',
        '  <option value="7">In-Balance</option>',
        '  <option value="9">Made Without Gluten</option>',
        '  <option value="57">Contains Nuts</option>',
        '  <option value="3">Seafood Watch</option>',
        '  <option value="1">Vegetarian</option>',
        '  <option value="4">Vegan</option>',
        '</select>',
        '<div id="widgetTitle" class="e"></div>',
        '<div id="date" class="e"></div>',
        '<div id="food" class="e"></div>',
        '<div id="footer"></div>',
    ].join('')
  },

  update: function(output, domEl) {

    var dietSelection = document.querySelector(".myDiet");
    dietSelection.onchange = function() {
        // save to LocalStorage every time we make a change
        saveSettings(dietSelection.value);
    };

    function saveSettings(diet) {
        var userSettings = {
            diet: diet,
        };

        localStorage.setItem('BonAppSettings', JSON.stringify(userSettings));

        var friendly = parseMenu(theMenu, diet);
        outputString = createOutputString(friendly);
        updateView();

        return;
    }

    function createOutputString(okItems){
        var str = "";
        for(var i = 0; i < okItems.length; i++){
            str += okItems[i] + "<br>";
        }
        return str;
    }

    function parseDate(x){
        var m,d,y;
        y=x.substr(0,4);
        m=x.substr(5,2);
        d=x.substr(8,2);

        var rawToday = new Date(y+"-"+m+"-"+d);
        var offsetDate = Date(rawToday - rawToday.getTimezoneOffset());
        var todayDate = new Date(offsetDate).toString();
        var today = todayDate.substr(0,10);

        return today.toString();
    }

    function parseCafe(json) {
        var id = ([Object.keys(json["days"][0]["cafes"])[0]]);
        var theTitle = json["days"][0]["cafes"][id]["name"];
        return theTitle;
    }

    function parseMenu(menu, diet){
        // your selected diets
        var preferredDiet = parseInt(diet);

        var okItems = [];
        var prevStation = "";
        var item = "";

        for(var prop in menu){
            // looping through the properties on an element
            if(menu.hasOwnProperty(prop)){
                // Icon (filtering dietary restrictions)
                if(menu[prop].cor_icon.hasOwnProperty(preferredDiet)){
                    // Station
                    if(menu[prop].station != prevStation){
                        // clean station string
                        item = "<br />" + cleanUpStationLabel(menu[prop].station + "<br />");
                        // push food label next to the station
                        item += "⚬ " + capitalizeStr(menu[prop].label, 0, 1);
                        // the previous station
                        prevStation = menu[prop].station;
                    }
                    // same station with more items
                    else {
                        // the served food item
                        item = "⚬ " + capitalizeStr(menu[prop].label, 0, 1);
                        // the previous station
                        prevStation = menu[prop].station;
                    }

                    // add it
                    okItems.push(item);
                }
            }
        }
        // Handle update on Mondays and 0 results
        if(okItems.length === 0) {
            // Body
            okItems.push("0 menu items found...");

            // Footer
            var theDay = new Date().getDay();
            if(theDay === 1) {
                var footer = document.getElementById("footer");
                footer.innerHTML = "*Note: the menu usually updates on Mondays";
            }
        }
<commit_msg>Fixed the visual layout with more than 1 item in a category<commit_after>
  command: 'curl -s "http://legacy.cafebonappetit.com/api/2/menus?cafe=261"',
  refreshFrequency: 6000000,



  render: function(output) {
    return [
        '<select class="myDiet">',
        '  <option value="-1">All</option>',
        '  <option value="6">Farm to Fork</option>',
        '  <option value="18">Humane</option>',
        '  <option value="7">In-Balance</option>',
        '  <option value="9">Made Without Gluten</option>',
        '  <option value="57">Contains Nuts</option>',
        '  <option value="3">Seafood Watch</option>',
        '  <option value="1">Vegetarian</option>',
        '  <option value="4">Vegan</option>',
        '</select>',
        '<div id="widgetTitle" class="e"></div>',
        '<div id="date" class="e"></div>',
        '<div id="food" class="e"></div>',
        '<div id="footer"></div>',
    ].join('')
  },

  update: function(output, domEl) {

    var dietSelection = document.querySelector(".myDiet");
    dietSelection.onchange = function() {
        // save to LocalStorage every time we make a change
        saveSettings(dietSelection.value);
    };

    function saveSettings(diet) {
        var userSettings = {
            diet: diet,
        };

        localStorage.setItem('BonAppSettings', JSON.stringify(userSettings));

        var friendly = parseMenu(theMenu, diet);
        outputString = createOutputString(friendly);
        updateView();

        return;
    }

    function createOutputString(okItems){
        var str = "";
        for(var i = 0; i < okItems.length; i++){
            str += okItems[i] + "<br>";
        }
        return str;
    }

    function parseDate(x){
        var m,d,y;
        y=x.substr(0,4);
        m=x.substr(5,2);
        d=x.substr(8,2);

        var rawToday = new Date(y+"-"+m+"-"+d);
        var offsetDate = Date(rawToday - rawToday.getTimezoneOffset());
        var todayDate = new Date(offsetDate).toString();
        var today = todayDate.substr(0,10);

        return today.toString();
    }

    function parseCafe(json) {
        var id = ([Object.keys(json["days"][0]["cafes"])[0]]);
        var theTitle = json["days"][0]["cafes"][id]["name"];
        return theTitle;
    }

    function parseMenu(menu, diet){
        // your selected diets
        var preferredDiet = parseInt(diet);

        var okItems = [];
        var prevStation = "";
        var item = "";

        for(var prop in menu){
            // looping through the properties on an element
            if(menu.hasOwnProperty(prop)){
                    // Icon (filtering dietary restrictions)
                    if(menu[prop].cor_icon.hasOwnProperty(preferredDiet) || preferredDiet == -1){
                        // Station
                        if(menu[prop].station != prevStation){
                            // clean station string
                            item = "<br />" + cleanUpStationLabel(menu[prop].station + "<br />");
                            // push food label next to the station
                            item += "⚬ " + capitalizeStr(menu[prop].label, 0, 1);
                            // the previous station
                            prevStation = menu[prop].station;
                        }
                        // same station with more items
                        else {
                            // the served food item
                            item = "⚬ " + capitalizeStr(menu[prop].label, 0, 1);
                            // the previous station
                            prevStation = menu[prop].station;
                        }
                        // add it
                        okItems.push(item);
                    }
                    // same station with more items
                    else {
                        // the served food item
                        item = "⚬ " + capitalizeStr(menu[prop].label, 0, 1);
                        // the previous station
                        prevStation = menu[prop].station;
                    }

                    // add it
                    okItems.push(item);
                }
            }
        }
        // Handle update on Mondays and 0 results
        if(okItems.length === 0) {
            // Body
            okItems.push("0 menu items found...");

            // Footer
            var theDay = new Date().getDay();
            if(theDay === 1) {
                var footer = document.getElementById("footer");
                footer.innerHTML = "*Note: the menu usually updates on Mondays";
            }
        }

{'fraction_non_alphanumeric': 0.13967961276939034, 'fraction_numerical': 0.01037224847297453, 'mean_word_length': 1.5270821199767035, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6354635', 'n_tokens_mistral': 2439, 'n_tokens_neox': 2333, 'n_words': 528}