<commit_before><?php

// The API key shouldn't be publically readable so we'll keep it in a non-public part of the web server.
// This file is just a proxy that adds the API key to the AJAX request.

ini_set('include_path', ini_get('include_path') . ':/home/jordanbr');
require_once('/home/jordanbr/NYT-Movie-Reviews-api-key.inc.php');	// defines $API_KEY_MOVIES

$endpoint = array_pop($_GET);	// remove endpoint from query (assumes endpoint is the final URL parameter)
$url = "{$endpoint}?api-key={$API_KEY_MOVIES}&" . http_build_query($_GET);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$json = curl_exec($ch);
curl_close($ch);<commit_msg>speeeeling<commit_after><?php

// The API key shouldn't be publicly readable so we'll keep it in a non-public part of the web server.
// This file is just a proxy that adds the API key to the AJAX request.

ini_set('include_path', ini_get('include_path') . ':/home/jordanbr');
require_once('/home/jordanbr/NYT-Movie-Reviews-api-key.inc.php');	// defines $API_KEY_MOVIES

$endpoint = array_pop($_GET);	// remove endpoint from query (assumes endpoint is the final URL parameter)
$url = "{$endpoint}?api-key={$API_KEY_MOVIES}&" . http_build_query($_GET);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$json = curl_exec($ch);
curl_close($ch);
{'fraction_non_alphanumeric': 0.1461794019933555, 'fraction_numerical': 0.00132890365448505, 'mean_word_length': 5.876712328767123, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2075144', 'n_tokens_mistral': 554, 'n_tokens_neox': 515, 'n_words': 141}