nxs_CptCheckGP

The NextScripts: Social Networks Auto-Poster nxs CptCheckGP function.

Description

nxs_CptCheckGP( $o ); 

Parameters (1)

0. $o
The o.

Usage

  1. if ( !function_exists( 'nxs_CptCheckGP' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextscripts-social-networks-auto-poster/inc-cl/gp.php'; 
  3.  
  4. // The o. 
  5. $o = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = nxs_CptCheckGP($o); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc-cl/gp.php  
  1. function nxs_CptCheckGP($o) { session_id("nxs-temp-gpcpt"); session_start(); $sess = unserialize($_SESSION['nxs-temp-gpcpt']); 
  2. if (!empty($_POST['c'])) { $ck = $sess['c']; $flds = $sess['f'];  
  3. $flds['recaptcha_response_field'] = $_POST['c']; $liObj = new nxsAPI_GP(); $hdrsArr = $liObj->headers('https://www.youtube.com/', 'https://www.youtube.com', 'POST', false); 
  4. $advSet = array('headers' => $hdrsArr, 'httpversion' => '1.1', 'timeout' => 45, 'redirection' => 0, 'cookies' => $ck, 'body' => $flds); prr($advSet); 
  5. $rep = nxs_remote_post('https://www.youtube.com/das_captcha', $advSet); if (is_nxs_error($rep)) { $badOut = print_r($rep, true)." - ERROR"; return $badOut; } $contents2 = $rep['body']; prr($rep);  
  6. if (stripos($contents2, 'id="error-box"')!==false) { echo 'The verification code was invalid or has timed out. Please try again.'; die(); }  
  7. if (stripos($contents2, 'The verification code was invalid')!==false) { echo 'The verification code was invalid or has timed out. Please try again.'; die(); }  
  8. if ($rep['response']['code']=='303' && !empty($rep['headers']['location']) ) { echo "OK. You are In";  
  9. $hdrsArr = $liObj->headers('http://www.youtube.com', 'https://www.youtube.com'); $ck = $rep['cookies'];  
  10. $advSet = array('headers' => $hdrsArr, 'httpversion' => '1.1', 'timeout' => 45, 'redirection' => 0, 'cookies' => $ck); // prr($advSet); 
  11. $rep = nxs_remote_get($rep['headers']['location'], $advSet); prr($ck); if (is_nxs_error($rep)) { $badOut = print_r($rep, true)." - ERROR"; return $badOut; } $ck = $rep['cookies'];  
  12. }