<commit_before><?php
$list = file_get_contents("input.txt");
$list = str_replace("\r", "", $list);
$list = explode("\n", $list);
$out = "";
foreach ($list as $page) {
	$res = file_get_contents("https://zh.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&rvlimit=1&rvdir=older&titles=".urlencode($page));
	$res = json_decode($res, true);
	$res = $res["query"]["pages"];
	$res = current($res);
	echo $res["revisions"][0]["timestamp"]." ".$page."\n";
	$out .= $res["revisions"][0]["timestamp"]."\t".$page."\n";
}
file_put_contents("out.csv", $out);<commit_msg>lastedit: show error msg<commit_after><?php
$list = file_get_contents("input.txt");
$list = str_replace("\r", "", $list);
$list = explode("\n", $list);
$out = "";
foreach ($list as $page) {
	$res = file_get_contents("https://zh.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&rvlimit=1&rvdir=older&titles=".urlencode($page));
	$res = json_decode($res, true);
	if (!isset($res["query"])) {
		var_dump($res);
		continue;
	}
	$res = $res["query"]["pages"];
	$res = current($res);
	if (!isset($res["revisions"])) {
		var_dump($res);
		continue;
	}
	echo $res["revisions"][0]["timestamp"]." ".$page."\n";
	$out .= $res["revisions"][0]["timestamp"]."\t".$page."\n";
}
file_put_contents("out.csv", $out);
{'fraction_non_alphanumeric': 0.2715953307392996, 'fraction_numerical': 0.004669260700389105, 'mean_word_length': 6.654761904761905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6842690', 'n_tokens_mistral': 510, 'n_tokens_neox': 502, 'n_words': 70}