nxs_getNXSHeaders

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

Description

nxs_getNXSHeaders( (string) $ref = '', (constant) $post = false ); 

Parameters (2)

0. $ref — Optional. (string) => ''
The ref.
1. $post — Optional. (constant) => false
The post.

Usage

  1. if ( !function_exists( 'nxs_getNXSHeaders' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextscripts-social-networks-auto-poster/nxs_functions.php'; 
  3.  
  4. // The ref. 
  5. $ref = ''; 
  6.  
  7. // The post. 
  8. $post = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = nxs_getNXSHeaders($ref, $post); 
  12.  

Defined (1)

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

/nxs_functions.php  
  1. if (!function_exists("nxs_getNXSHeaders")) { function nxs_getNXSHeaders($ref='', $post=false) { $hdrsArr = array();  
  2. $hdrsArr['Connection']='keep-alive'; $hdrsArr['Referer']=$ref; 
  3. $hdrsArr['User-Agent']='Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.22 Safari/537.11'; 
  4. if($post) $hdrsArr['Content-Type']='application/x-www-form-urlencoded';  
  5. $hdrsArr['Accept']='application/json, text/javascript, */*; q=0.01';  
  6. if (function_exists('gzdeflate')) $hdrsArr['Accept-Encoding']='gzip, deflate, sdch';  
  7. $hdrsArr['Accept-Language']='en-US, en;q=0.8'; $hdrsArr['Accept-Charset']='ISO-8859-1, utf-8;q=0.7, *;q=0.3'; return $hdrsArr; 
  8. }}