<commit_before>/* 
 * File:   CFJudger.cpp
 * Author: 51isoft
 * 
 * Created on 2014年2月1日, 上午12:02
 */

#include "CFJudger.h"

/**
 * Create a CF Judger
 * @param _info Should be a pointer of a JudgerInfo
 */
CFJudger::CFJudger(JudgerInfo * _info) : VirtualJudger(_info) {
    socket->sendMessage(CONFIG->GetJudge_connect_string() + "\nCodeForces");
    
    language_table["1"]  = "1";
    language_table["2"]  = "10";
    language_table["3"]  = "5";
    language_table["4"]  = "4";
    language_table["5"]  = "7";
    language_table["6"]  = "9";
    language_table["9"]  = "8";
    language_table["12"] = "2";
}

CFJudger::~CFJudger() {
}


/**
 * Get Csrf token
 * @param url   URL you need to get csrf token
 * @return Csrf token for current session
 */
string CFJudger::getCsrfParams(string url) {
    
    prepareCurl();    
    curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
    performCurl();
    
    // Format: <meta name="X-Csrf-Token" content="<PASSWORD>"/><commit_msg>update CF language table<commit_after>/* 
 * File:   CFJudger.cpp
 * Author: 51isoft
 * 
 * Created on 2014年2月1日, 上午12:02
 */

#include "CFJudger.h"

/**
 * Create a CF Judger
 * @param _info Should be a pointer of a JudgerInfo
 */
CFJudger::CFJudger(JudgerInfo * _info) : VirtualJudger(_info) {
    socket->sendMessage(CONFIG->GetJudge_connect_string() + "\nCodeForces");
    
    language_table["1"]  = "1";
    language_table["2"]  = "10";
    language_table["3"]  = "23";
    language_table["4"]  = "4";
    language_table["5"]  = "7";
    language_table["6"]  = "9";
    language_table["9"]  = "8";
    language_table["12"] = "2";
}

CFJudger::~CFJudger() {
}


/**
 * Get Csrf token
 * @param url   URL you need to get csrf token
 * @return Csrf token for current session
 */
string CFJudger::getCsrfParams(string url) {
    
    prepareCurl();    
    curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
    performCurl();
    
    // Format: <meta name="X-Csrf-Token" content="<PASSWORD>"/>
{'fraction_non_alphanumeric': 0.1686868686868687, 'fraction_numerical': 0.03080808080808081, 'mean_word_length': 3.3827433628318584, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '3791396', 'n_tokens_mistral': 793, 'n_tokens_neox': 741, 'n_words': 154}