<commit_before><?php
/*
 * Function to fetch a page and return it content
 */
function curl($url){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    $return = curl_exec($ch);
    curl_close ($ch);
    return $return;
}

    //echo $factor;
    $make= 'http://www.startupranking.com/countries';
    // get page contents
    $url = curl($make);
    //echo $url;
    $regex = "/<div class=\"name\"?>.*<a.*?>([^`]*?)<\/a><\/div>/";

    /*$regex = "/<td>.*<a.*?>([^`]*?)<\/a><\/td>/";
    */$regex = '/<td><a href="\/top\/([^"]*)">/';
    preg_match_all($regex, $url, $restoNames);
    $obj = new stdClass();
    $arr = array();
    //echo $restoNames[0][0];
    foreach($restoNames[1] as $key => $value) {
      //echo strip_tags($value);
      array_push($arr, strip_tags($value));
    }
    $obj->countries = $arr;
    file_put_contents('supported-countries.json', json_encode($obj));
    //print_r($restoNames[0]); //View the array to see if it worked<commit_msg>beautify code, removed unused code<commit_after><?php
/*
 * Function to fetch a page and return it content
 */
function curl($url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $return = curl_exec($ch);
    curl_close($ch);
    return $return;
}

$make  = 'http://www.startupranking.com/countries';
// get page contents
$url   = curl($make);
$regex = '/<td><a href="\/top\/([^"]*)">/';
preg_match_all($regex, $url, $countryNames);
$obj = new stdClass();
$arr = array();
//echo $restoNames[0][0];
foreach ($countryNames[1] as $key => $value) {
    //echo strip_tags($value);
    array_push($arr, strip_tags($value));
}
$obj->countries = $arr;
file_put_contents('supported-countries.json', json_encode($obj));
{'fraction_non_alphanumeric': 0.22511061946902655, 'fraction_numerical': 0.00497787610619469, 'mean_word_length': 3.6744186046511627, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '1313183', 'n_tokens_mistral': 671, 'n_tokens_neox': 660, 'n_words': 135}