<commit_before><?php
// $url = "http://www.baidu.com/link?url=NG5rRHoP_U6OF55nvq5Ok_6P7FQFTeKtJ1S0kVK8l68gFfeeOauHg-xNhIjWHYNs";
function curl_post_302($url, $vars = null){
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_URL, $url);
	if(is_null($vars))
		curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // 302 redirect
	if(is_null($vars))
		curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
	$data = curl_exec($ch);
	$Headers =  curl_getinfo($ch);
	curl_close($ch);
	if($data != $Headers){
		return  $Headers['url'];
	}else{
		return false;
	}
}
$url = isset($_POST['u']) ? $_POST['u'] : isset($_GET['u']) ? $_GET['u'] : null;
echo $url;
if($url){
	$info = parse_url($url);
	echo '<pre>';
	print_r($info);
	print_r(curl_post_302($url));
	echo '</pre>';<commit_msg>修改<commit_after><?php
// $url = "http://www.baidu.com/link?url=NG5rRHoP_U6OF55nvq5Ok_6P7FQFTeKtJ1S0kVK8l68gFfeeOauHg-xNhIjWHYNs";
function curl_post_302($url, $vars = null){
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_URL, $url);
	if(!is_null($vars))
		curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // 302 redirect
	if(!is_null($vars))
		curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
	$data = curl_exec($ch);
	$Headers =  curl_getinfo($ch);
	curl_close($ch);
	if($data != $Headers){
		return  $Headers['url'];
	}else{
		return false;
	}
}
$url = isset($_POST['u']) ? $_POST['u'] : isset($_GET['u']) ? $_GET['u'] : null;
echo $url;
if($url){
	$info = parse_url($url);
	echo '<pre>';
	print_r($info);
	print_r(curl_post_302($url));
	echo '</pre>';
{'fraction_non_alphanumeric': 0.211665664461816, 'fraction_numerical': 0.028863499699338546, 'mean_word_length': 6.529411764705882, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1301169', 'n_tokens_mistral': 812, 'n_tokens_neox': 748, 'n_words': 113}