<commit_before>var cheerio = require('cheerio');
var request = require('request');
var moment = require('moment');
var dateFormat = 'DD.MM.YYYY';

module.exports = {
  retrieve: function (callback) {
    request({
      method: 'GET',
      url: 'http://www.netzwerk111.at/restaurant-hartberg/mittagsmenu/'
    }, function (err, response, body) {
      if (err) {
        callback(err);
        return;
      }

      $ = cheerio.load(body, {
        normalizeWhitespace: true,
        xmlMode: true
      });

      var result = [];

      $('.menu-category').each(function (i, category) {
        if (i > 0) {  // skip general menu
          var weekDescription;

          $(category).each(function (i, element) {
            weekDescription = $(element).text().trim();
          });

          $(category).parent().find('.menu-item').each(function (i, item) {
            var date = moment($(item).find('.menu-title2').text(), dateFormat);
            var menuItems = $(item).find('.menu-description2').text().split('Menü')
                .filter(function (element, index) {
                  return index !== 0;
                })
                .map(function (meal) {
                  var idx = meal.indexOf('- oder -');

                  if (idx !== -1) {
                    meal = meal.substring(4, idx);
                  } else {
                    meal = meal.substring(4);
                  }

                  return meal.trim();
                });

            result.push({
              date: date.format('YYYY-MM-DD'),
              items: menuItems,
              week: date.format('W')
            });
          });
        }
      });

      callback(undefined, result);
    });
  }
};<commit_msg>Adjustment of the page parse caused by structure changes of the netwerk111.at website<commit_after>var cheerio = require('cheerio');
var request = require('request');
var moment = require('moment');
var dateFormat = 'DD.MM.YYYY';

module.exports = {
  retrieve: function (callback) {
    request({
      method: 'GET',
      url: 'http://www.netzwerk111.at/restaurant-hartberg/mittagsmenu/'
    }, function (err, response, body) {
      if (err) {
        callback(err);
        return;
      }

      $ = cheerio.load(body, {
        normalizeWhitespace: true,
        xmlMode: true
      });

      var result = [];

      $('.menu1').each(function (i, category) {
          var weekDescription;

          $(category).each(function (i, element) {
            weekDescription = $(element).text().trim();
          });

          $(category).parent().find('.menu-item').each(function (i, item) {
            var date = moment($(item).find('.menu-title2').text(), dateFormat);
            var menuItems = $(item).find('.menu-description2').text().split('Menü')
                .filter(function (element, index) {
                  return index !== 0;
                })
                .map(function (meal) {
                  var idx = meal.indexOf('- oder -');

                  if (idx !== -1) {
                    meal = meal.substring(4, idx);
                  } else {
                    meal = meal.substring(4);
                  }

                  return meal.trim();
                });

            result.push({
              date: date.format('YYYY-MM-DD'),
              items: menuItems,
              week: date.format('W')
            });
          });
      });

      callback(undefined, result);
    });
  }
};
{'fraction_non_alphanumeric': 0.15746893961282865, 'fraction_numerical': 0.0066454781854955215, 'mean_word_length': 1.5455882352941177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '6994018', 'n_tokens_mistral': 983, 'n_tokens_neox': 930, 'n_words': 194}