<commit_before>// this script generates the timezone and supported parks lists found in the README.md
var fs = require("fs");
var path = require("path");
var DisneyAPI = require("../index");

var timezoneMarkdown = "";
var supportedParksMarkdown = "";
var parkFeaturesMarkdown =
  "|Park|Wait Times|Park Opening Times|Ride Opening Times|\n" +
  "|:---|:---------|:-----------------|:-----------------|\n";

// search for these tags to inject our new content
var supportedParkListStart = "<!-- START_SUPPORTED_PARKS_LIST -->";
var supportedParkListEnd = "<!-- END_SUPPORTED_PARKS_LIST -->";
var timezoneListStart = "<!-- START_PARK_TIMEZONE_LIST -->";
var timezoneListEnd = "<!-- END_PARK_TIMEZONE_LIST -->";
var parkFeaturesListStart = "<!-- START_PARK_FEATURES_SUPPORTED -->";
var parkFeaturesListEnd = "<!-- END_PARK_FEATURES_SUPPORTED -->";

// local path to the README file
var readmeFilePath = path.join(__dirname, "..", "README.md");



for (var park in DisneyAPI) {
  var parkObj = new DisneyAPI[park]();
  // print out each supported park object name and "pretty name"
  supportedParksMarkdown += "* " + parkObj.name + " (DisneyAPI." + park + ")\n";
  // print each park's timezone into timezoneMarkdown
  timezoneMarkdown += "    * " + parkObj.name + " => " + parkObj.park_timezone + "\n";

  parkFeaturesMarkdown +=
    "|" + parkObj.name + "|:thumbsup:|:thumbsup:|" + (parkObj.supports_ride_schedules ? ":thumbsup:" : ":heavy_multiplication_x:") + "|\n";
}

// read in README.md
fs.readFile(readmeFilePath, function(err, readmeData) {
  if (err) return console.log(err);

  // convert buffer to string
  readmeData = readmeData.toString();

  // find START/END comments and replace with new content
  var newReadmeData = readmeData.replace(
    new RegExp(supportedParkListStart + "[^<]*" + supportedParkListEnd, 'g'),
    supportedParkListStart + "\n" + supportedParksMarkdown + "\n" + supportedParkListEnd
  );
  newReadmeData = newReadmeData.replace(
    new RegExp(timezoneListStart + "[^<]*" + timezoneListEnd, 'g'),
    timezoneListStart + "\n" + timezoneMarkdown + "\n" + timezoneListEnd
  );
  newReadmeData = newReadmeData.replace(<commit_msg>README now uses unicode ticks and crosses for displaying if a feature is available for each park<commit_after>// this script generates the timezone and supported parks lists found in the README.md
var fs = require("fs");
var path = require("path");
var DisneyAPI = require("../index");

var timezoneMarkdown = "";
var supportedParksMarkdown = "";
var parkFeaturesMarkdown =
  "|Park|Wait Times|Park Opening Times|Ride Opening Times|\n" +
  "|:---|:---------|:-----------------|:-----------------|\n";

// search for these tags to inject our new content
var supportedParkListStart = "<!-- START_SUPPORTED_PARKS_LIST -->";
var supportedParkListEnd = "<!-- END_SUPPORTED_PARKS_LIST -->";
var timezoneListStart = "<!-- START_PARK_TIMEZONE_LIST -->";
var timezoneListEnd = "<!-- END_PARK_TIMEZONE_LIST -->";
var parkFeaturesListStart = "<!-- START_PARK_FEATURES_SUPPORTED -->";
var parkFeaturesListEnd = "<!-- END_PARK_FEATURES_SUPPORTED -->";

// local path to the README file
var readmeFilePath = path.join(__dirname, "..", "README.md");

// symbols to use for parks supporting/not-supporting features
var featureAvailable = "&#10003;";
var featureUnavailable = "&#10007;";

for (var park in DisneyAPI) {
  var parkObj = new DisneyAPI[park]();
  // print out each supported park object name and "pretty name"
  supportedParksMarkdown += "* " + parkObj.name + " (DisneyAPI." + park + ")\n";
  // print each park's timezone into timezoneMarkdown
  timezoneMarkdown += "    * " + parkObj.name + " => " + parkObj.park_timezone + "\n";

  parkFeaturesMarkdown +=
    "|" + parkObj.name + "|" + featureAvailable + "|" + featureAvailable + "|" + (parkObj.supports_ride_schedules ? featureAvailable : featureUnavailable) + "|\n";
}

// read in README.md
fs.readFile(readmeFilePath, function(err, readmeData) {
  if (err) return console.log(err);

  // convert buffer to string
  readmeData = readmeData.toString();

  // find START/END comments and replace with new content
  var newReadmeData = readmeData.replace(
    new RegExp(supportedParkListStart + "[^<]*" + supportedParkListEnd, 'g'),
    supportedParkListStart + "\n" + supportedParksMarkdown + "\n" + supportedParkListEnd
  );
  newReadmeData = newReadmeData.replace(
    new RegExp(timezoneListStart + "[^<]*" + timezoneListEnd, 'g'),
    timezoneListStart + "\n" + timezoneMarkdown + "\n" + timezoneListEnd
  );
  newReadmeData = newReadmeData.replace(
{'fraction_non_alphanumeric': 0.16465951390409458, 'fraction_numerical': 0.0021896211955331727, 'mean_word_length': 4.01978021978022, 'pattern_counts': {'":': 2, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 0, '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': '1423491', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1407, 'n_words': 355}