<commit_before><?php
namespace php_active_record;
/* connector for MarLIN - Marine Life Information Network
Partner provides the EOL XML.
This connector just loads the partner resource and removes erroneous string(s).
estimated execution time: 20 seconds
*/

include_once(dirname(__FILE__) . "/../../config/environment.php");
$timestart = time_elapsed();
$resource_id = 195;
$file = "http://www.marlin.ac.uk/downloads/EOL/EOL.xml";
//$contents = Functions::get_remote_file($file); this one, operation times out
$contents = file_get_contents($file);
$contents = str_ireplace("No text entered", "", $contents);  
$contents = str_ireplace("<![CDATA[", "", $contents);  
$contents = str_ireplace("]]>", "", $contents);  
$resource_path = CONTENT_RESOURCE_LOCAL_PATH . $resource_id . ".xml";
$OUT = fopen($resource_path, "w");
fwrite($OUT, $contents);
fclose($OUT);
// set to force harvest
if(filesize(CONTENT_RESOURCE_LOCAL_PATH . $resource_id . ".xml"))
{
    $GLOBALS['db_connection']->update("UPDATE resources SET resource_status_id=" . ResourceStatus::force_harvest()->id . " WHERE id=" . $resource_id);
}
$elapsed_time_sec = time_elapsed() - $timestart;
echo "\n";
echo "elapsed time = $elapsed_time_sec sec              \n";
echo "elapsed time = " . $elapsed_time_sec/60 . " min   \n";
echo "elapsed time = " . $elapsed_time_sec/60/60 . " hr \n";
exit("\nDone processing.");
?><commit_msg>Update MarLIN connector.<commit_after><?php
namespace php_active_record;
/* connector for MarLIN - Marine Life Information Network
Partner provides the EOL XML.
This connector just loads the partner resource and removes erroneous string(s).
estimated execution time: 81 seconds
*/

include_once(dirname(__FILE__) . "/../../config/environment.php");
$timestart = time_elapsed();
$resource_id = 195;
$file = "http://www.marlin.ac.uk/downloads/EOL/EOL.xml";
$contents = Functions::get_remote_file($file, DOWNLOAD_WAIT_TIME, 999999);
$contents = str_ireplace("No text entered", "", $contents);  
$contents = str_ireplace("<![CDATA[", "", $contents);  
$contents = str_ireplace("]]>", "", $contents);  
$resource_path = CONTENT_RESOURCE_LOCAL_PATH . $resource_id . ".xml";
$OUT = fopen($resource_path, "w");
fwrite($OUT, $contents);
fclose($OUT);
Functions::set_resource_status_to_force_harvest($resource_id);
$elapsed_time_sec = time_elapsed() - $timestart;
echo "\n";
echo "elapsed time = $elapsed_time_sec sec              \n";
echo "elapsed time = " . $elapsed_time_sec/60 . " min   \n";
echo "elapsed time = " . $elapsed_time_sec/60/60 . " hr \n";
exit("\nDone processing.");
?>
{'fraction_non_alphanumeric': 0.16210045662100456, 'fraction_numerical': 0.0106544901065449, 'mean_word_length': 4.523109243697479, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2474226', 'n_tokens_mistral': 894, 'n_tokens_neox': 886, 'n_words': 201}