<commit_before>const request = require('request');

// https://github.com/cheeriojs/cheerio
const cheerio = require('cheerio');

const movieData = {};

request('https://booking.sfcinemacity.com/visPrintShowTimes.aspx?visLang=1&visCinemaId=9936', (err, httpResponse, body) => {
  const $ = cheerio.load(body);

  let currentMovie;
  let currentDate;
  $('#tblShowTimes td').each(function () {
    //console.log($(this).text());
    if ($(this).hasClass('PrintShowTimesFilm')) {
      currentMovie = $(this).text();
      movieData[currentMovie] = {};
    } else if ($(this).hasClass('PrintShowTimesDay')) {
      currentDate = $(this).text();
    } else if ($(this).hasClass('PrintShowTimesSession')) {
      movieData[currentMovie][currentDate] = $(this).text();
    }
  });

  console.log(movieData);
});<commit_msg>fetching, collating and outputting movie data<commit_after>const request = require('request');

// https://github.com/cheeriojs/cheerio
const cheerio = require('cheerio');

const movieData = {};

// collate the movie data
request('https://booking.sfcinemacity.com/visPrintShowTimes.aspx?visLang=1&visCinemaId=9936', (err, httpResponse, body) => {
  const $ = cheerio.load(body);

  let currentMovie;
  let currentDate;
  $('#tblShowTimes td').each(function () {
    if ($(this).hasClass('PrintShowTimesFilm')) {
      currentMovie = $(this).text();
      movieData[currentMovie] = {};
    } else if ($(this).hasClass('PrintShowTimesDay')) {
      currentDate = $(this).text();
    } else if ($(this).hasClass('PrintShowTimesSession')) {
      movieData[currentMovie][currentDate] = $(this).text();
    }
  });

  // test out the data by showing movie info for x days ahead..
  const daysAhead = 1;
  const targetDate = new Date();
  targetDate.setDate(targetDate.getDate() + daysAhead);

  console.log(`Target date is ${targetDate.toDateString()}`);

  for (const movieName of Object.keys(movieData)) {
    for (const movieDate of Object.keys(movieData[movieName])) {
      if (movieDate.includes(` ${targetDate.getDate()} `)) {
        console.log(`${movieName} is showing at ${movieData[movieName][movieDate]}`);
      }
    }
  }
});
{'fraction_non_alphanumeric': 0.17835578262888993, 'fraction_numerical': 0.005109150023223409, 'mean_word_length': 4.292383292383293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '2826297', 'n_tokens_mistral': 711, 'n_tokens_neox': 677, 'n_words': 126}