Server IP : 103.119.228.120 / Your IP : 18.191.165.149 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/hendraso/public_html/Library/ |
Upload File : |
<?php class Curl { static function instance(){ return new Curl; } function checkApiKey($url, $apikey) { $ch = curl_init(); $defaults = array( CURLOPT_URL => $url, CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: API_KEY ' . $apikey )); $response = curl_exec($ch); if ($response === false) { $response = curl_error($ch); return $response; }else{ $http_status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //echo $http_status_code;die('ble'); /*if($http_status_code == 204) { $ret = json_encode(array("status" => "ok", "status_code" => $http_status_code)); }else{ $ret = $response; }*/ return json_encode(array("status_code" => $http_status_code, "response" => json_decode($response))); } } function apiGet($url, $apikey) { $ch = curl_init(); $defaults = array( CURLOPT_URL => $url, CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: API_KEY ' . $apikey, 'Content-type: application/json' )); $response = curl_exec($ch); if ($response === false) $response = curl_error($ch); curl_close($ch); return json_decode($response, true); } function apiPost($url,$arrdata) { $ch = curl_init(); $defaults = array( CURLOPT_URL => $url, CURLOPT_HEADER => TRUE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_CUSTOMREQUEST => 'POST', /*CURLOPT_POSTFIELDS => $arrdata,*/ CURLOPT_SAFE_UPLOAD => FALSE, CURLOPT_POST => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/octet-stream; charset=UTF-8', 'Connection: Keep-Alive' )); echo $response = curl_exec($ch); if ($response === false) $response = curl_error($ch); //print_r(curl_getinfo($ch)); //$http_status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return json_decode($response, true); } function apiPut($url, $apikey, $arrdata) { $ch = curl_init(); $defaults = array( CURLOPT_URL => $url, CURLOPT_HEADER => TRUE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $arrdata, CURLOPT_POST => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: API_KEY ' . $apikey )); $response = curl_exec($ch); if ($response === false) $response = curl_error($ch); curl_close($ch); return json_decode($response, true); } function deleteApi($url, $apikey = false) { $ch = curl_init(); $defaults = array( CURLOPT_URL => $url, CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_CUSTOMREQUEST => 'DELETE', CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); if($apikey) { curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: API_KEY ' . $apikey )); } $response = curl_exec($ch); if ($response === false) { $response = curl_error($ch); return $response; }else{ $http_status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //echo $http_status_code;die('ble'); if($http_status_code == 204) { $ret = json_encode(array("status" => "ok", "status_code" => $http_status_code)); }else{ $ret = $response; } return $ret; } } function crawling($url) { $ch = curl_init(); $defaults = array( CURLOPT_URL => $url, CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36", CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); $response = curl_exec($ch); if ($response === false) $response = curl_error($ch); curl_close($ch); return $response; } function grab_image($url,$saveto){ /*$ch = curl_init ($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); $raw=curl_exec($ch); curl_close ($ch);*/ $ch = curl_init(); $defaults = array( CURLOPT_URL => $url, CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36", CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); $response = curl_exec($ch); if ($response === false) $response = curl_error($ch); curl_close($ch); if(file_exists($saveto)){ unlink($saveto); } $fp = fopen($saveto,'x'); fwrite($fp, $response); fclose($fp); } function download($url, $saveto) { $ch = curl_init(); if(file_exists($saveto)){ unlink($saveto); } $fp = fopen ($saveto, 'w+'); $defaults = array( CURLOPT_URL => $url, CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36", CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_FILE => $fp, CURLOPT_FOLLOWLOCATION => TRUE, ); curl_setopt_array ( $ch, $defaults ); $response = curl_exec($ch); if ($response === false) $response = curl_error($ch); curl_close($ch); return $response; } function apiAlpari($arrdata) { $postData = ""; if(is_array($arrdata)) { foreach( $arrdata as $key => $val ) { $postData .=$key."=".$val."&"; } $postData = rtrim($postData, "&"); } $ch = curl_init(); $defaults = array( CURLOPT_URL => "https://ws.alpari.ru/gtt/partner_report.php", CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $postData, CURLOPT_SAFE_UPLOAD => FALSE, CURLOPT_POST => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); $response = curl_exec($ch); if ($response === false) $response = curl_error($ch); //$http_status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return $response; } function apiHashoffer($args) { if (!defined('HASOFFERS_API_URL')) { define('HASOFFERS_API_URL', 'https://api.hasoffers.com/Apiv3/json'); } $curlHandle = curl_init(); curl_setopt($curlHandle, CURLOPT_URL, HASOFFERS_API_URL . '?' . http_build_query($args)); curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, 0); $jsonEncodedApiResponse = curl_exec($curlHandle); $apiResponse = json_decode($jsonEncodedApiResponse, true); //print_r($apiResponse);die; if($apiResponse['response']['status'] === 1) { return $apiResponse['response']['data']['data']; } else { return $apiResponse['response']['errors']; } } function apiPerformanceHorizonExec($param) { $publisherid = $param['pub_id']; $start = $param['from']; $to = empty($param['to']) ? $param['from'] : $param['to']; $startDate = date('Y-m-d', strtotime($start)); $startDate = urlencode($startDate . "T00:00:01Z"); $endDate = date('Y-m-d', strtotime($to)); $endDate = urlencode($endDate . "T23:59:59Z"); $ch = curl_init(); $url = "https://vgfcxr31pj:ususdr9t@api.performancehorizon.com/reporting/report_publisher/publisher/{$publisherid}/conversion.json?start_date={$startDate}&end_date={$endDate}&convert_currency=IDR"; $defaults = array( CURLOPT_URL => $url, CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36", CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); $response = json_decode(curl_exec($ch), true); curl_close($ch); $response["url_access"] = $url; return $response; } function apiPerformanceHorizon() { $publisherid = !empty($_POST['merchantid']) ? $_POST['merchantid'] : ""; $start = $_POST['from']; $to = empty($_POST['to']) ? $_POST['from'] : $_POST['to']; $startDate = date('Y-m-d', strtotime($start)); $startDate = urlencode($startDate . "T00:00:01Z"); $endDate = date('Y-m-d', strtotime($to)); $endDate = urlencode($endDate . "T23:59:59Z"); $status = empty($_POST['status']) ? 'mixed' : $_POST['status']; $ch = curl_init(); $defaults = array( //CURLOPT_URL => "https://VGfcXR31Pj:usuSDR9T@api.performancehorizon.com/reporting/report_publisher/publisher/1100l12051/overview.json?start_date={$startDate}&end_date={$endDate}", //CURLOPT_URL => "https://vgfcxr31pj:ususdr9t@api.performancehorizon.com/reporting/report_publisher/publisher/{$publisherid}/conversion.json?start_date={$startDate}&end_date={$endDate}¤cy=IDR&statuses={$status}", //CURLOPT_URL => "https://vgfcxr31pj:ususdr9t@api.performancehorizon.com/reporting/report_publisher/publisher/{$publisherid}/conversion.json?start_date={$startDate}&end_date={$endDate}¤cy=IDR", CURLOPT_URL => "https://vgfcxr31pj:ususdr9t@api.performancehorizon.com/reporting/report_publisher/publisher/{$publisherid}/conversion.json?start_date={$startDate}&end_date={$endDate}¤cy=IDR", CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36", CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, //CURLOPT_CUSTOMREQUEST => 'POST', //CURLOPT_SAFE_UPLOAD => FALSE, //CURLOPT_POST => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); //$response = curl_exec($ch); //if ($response === false) $response = curl_error($ch); $response = json_decode(curl_exec($ch), true); //$http_status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return $response; } function trackingTag($url) { $ch = curl_init(); $defaults = array( CURLOPT_URL => $url, CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); $response = curl_exec($ch); if ($response === false) { $response = curl_error($ch); return $response; }else{ $http_status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); return $http_status_code; } } function tokenBlibli() { $ch = curl_init(); $defaults = array( CURLOPT_URL => "https://api.blibli.com/oauth/token?grant_type=client_credentials", //CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36", CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => "grant_type=client_credentials", CURLOPT_POST => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization:Basic aW50ZXJzcGFjZS1jbGllbnQtaWQ6NDEzNTljYWQtNmNiOC00YzBkLTg2ZTgtZGE1NzZmNjE5MDVk', 'Content-type:application/json' )); $response = curl_exec($ch); if ($response === false) $response = curl_error($ch); curl_close($ch); return json_decode($response, true); } function dataBlibli($token, $index = 0) { $ch = curl_init(); $defaults = array( CURLOPT_URL => "https://api.blibli.com/product-data-feed?searchTerm=.&beginIndex={$index}", CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36", CURLOPT_HEADER => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0 ); curl_setopt_array ( $ch, $defaults ); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Authorization:bearer {$token}", "Content-type:application/json" )); $response = curl_exec($ch); if ($response === false) $response = curl_error($ch); curl_close($ch); return json_decode($response, true); } function apiPostCron($url, $apikey, $arrdata, $httpbuild = false) { $postData = ""; /*if(is_array($arrdata)) { foreach( $arrdata as $key => $val ) { $postData .=$key."=".$val."&"; } $postData = rtrim($postData, "&"); }*/ //echo $arrdata; if($httpbuild == false) { $postData = $arrdata; }else{ $postData = http_build_query($arrdata); } $ch = curl_init(); $defaults = array( CURLOPT_URL => $url, CURLOPT_HEADER => FALSE, CURLOPT_POST => TRUE, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $postData, //CURLOPT_POSTFIELDS => http_build_query($postData), CURLOPT_SAFE_UPLOAD => FALSE, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_RETURNTRANSFER => TRUE, ); curl_setopt_array ( $ch, $defaults ); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: API_KEY ' . $apikey, //'Content-Type: application/octet-stream; charset=UTF-8', 'Connection: Keep-Alive' )); $response = curl_exec($ch); if ($response === false) $response = curl_error($ch); //print_r(curl_getinfo($ch)); //$http_status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return json_decode($response, true); } }