<commit_before><?php

/*******************************************************************************

VBulletin API

autor:          bebop
last update:    03.12.2013

beispiele:
$vb = new VB;
$vb->login(URL, USER, PASS);
$vb->new_thread(ID, TITEL, TEXT);
$vb->postreply(ID, TITEL, TEXT);


have fun!

bitcoin:    1H7YZLC1TzeA6qQVFHLtMMmDx8GsxLucid

*******************************************************************************/

/***
  
***/
function debugger($code)
{
    $handler = fopen("vbulletin_error_log.html", "w+");
    fwrite($handler, $code);
    fclose($handler);
}

function grab_page($url, $ref_url = false, $data = false, $login = false){
	  $ch = curl_init();
	  $cookie=parse_url($url, PHP_URL_HOST).".cookie";
	  if( $login ) {
	      $handler=fopen($cookie, "w+");
	      fclose($handler);
	  }
	  // if you need a proxy than change this!
	  if (true) {
		  curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
		  curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
		  curl_setopt($ch, CURLOPT_PROXY, "127.0.0.1:9150");
	  }
	  curl_setopt($ch, CURLOPT_URL, $url);
	  curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
	  curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
	  curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0.2) Gecko/20100101 Firefox/10.0.2");
	  curl_setopt($ch, CURLOPT_TIMEOUT, 40);
	  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
	  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	  curl_setopt($ch, CURLOPT_HEADER, TRUE);
	  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
	  curl_setopt($ch, CURLOPT_POST, TRUE);
	  if( $ref_url ) curl_setopt($ch, CURLOPT_REFERER, $ref_url);
	  if( $data ) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
	  //ob_start();
	  $exec = curl_exec ($ch); // execute the curl command
	  $info = curl_getinfo($ch);
	  //ob_end_clean();
	  curl_close ($ch);
	  unset($ch);
	  return array( $exec, $info );
}

class vbulletin
{
    var $forum;<commit_msg>:kiss: the vbulletin class<commit_after><?php

/*******************************************************************************

VBulletin API

autor:          bebop
last update:    03.12.2013

beispiele:
$vb = new VB;
$vb->login(URL, USER, PASS);
$vb->new_thread(ID, TITEL, TEXT);
$vb->postreply(ID, TITEL, TEXT);


have fun!

bitcoin:    1H7YZLC1TzeA6qQVFHLtMMmDx8GsxLucid

*******************************************************************************/

/***
  
***/
function debugger($code)
{
    $handler = fopen("vbulletin_error_log.html", "w+");
    fwrite($handler, $code);
    fclose($handler);
}

function grab_page($url, $ref_url = false, $data = false, $login = false){
	  $ch = curl_init();
	  $cookie=parse_url($url, PHP_URL_HOST).".cookie";
	  if( $login ) {
	      $handler=fopen($cookie, "w+");
	      fclose($handler);
	  }
	  // if you need a proxy than change this!
	  if (false) {
		  curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
		  curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
		  curl_setopt($ch, CURLOPT_PROXY, "127.0.0.1:9150");
	  }
	  curl_setopt($ch, CURLOPT_URL, $url);
	  curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
	  curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
	  curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0.2) Gecko/20100101 Firefox/10.0.2");
	  curl_setopt($ch, CURLOPT_TIMEOUT, 40);
	  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
	  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	  curl_setopt($ch, CURLOPT_HEADER, TRUE);
	  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
	  curl_setopt($ch, CURLOPT_POST, TRUE);
	  if( $ref_url ) curl_setopt($ch, CURLOPT_REFERER, $ref_url);
	  if( $data ) curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
	  //ob_start();
	  $exec = curl_exec ($ch); // execute the curl command
	  $info = curl_getinfo($ch);
	  //ob_end_clean();
	  curl_close ($ch);
	  unset($ch);
	  return array( $exec, $info );
}

class vbulletin
{
    var $forum;
{'fraction_non_alphanumeric': 0.22981056829511465, 'fraction_numerical': 0.025423728813559324, 'mean_word_length': 4.716524216524217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6566988', 'n_tokens_mistral': 1740, 'n_tokens_neox': 1540, 'n_words': 284}