Current File : /home/honehdyv/reversevillain.com/wp-content/plugins/wp-automatic/core.careerjet.php
<?php

// Main Class
require_once 'core.php';

Class WpAutomaticCareerjet extends wp_automatic{
	
	
	
	function careerjet_fetch_items($keyword, $camp) {
		
		echo "<br>So, I should now get some items from Careerjet for keyword:".$keyword ;
		
		// ini options
		$camp_opt = unserialize ( $camp->camp_options );
		if( stristr($camp->camp_general, 'a:') ) $camp->camp_general=base64_encode($camp->camp_general);
		$camp_general = unserialize ( base64_decode( $camp->camp_general ) );
		$camp_general=array_map('wp_automatic_stripslashes', $camp_general);
		
		// items url
		 
		// get start-index for this keyword
		$query = "select keyword_start ,keyword_id from {$this->wp_prefix}automatic_keywords where keyword_name='$keyword' and keyword_camp={$camp->camp_id}";
		$rows = $this->db->get_results ( $query );
		@$row = $rows [0];
		
		//If no rows add a keyword record
		if(count($rows) == 0){
			$query="insert into {$this->wp_prefix}automatic_keywords(keyword_name,keyword_camp,keyword_start) values ('$keyword','{$camp->camp_id}',1)";
			$this->db->query($query);
			$kid = $this->db->insert_id;
			$start = 1;
			
		}else{
			$kid = $row->keyword_id;
			$start = $row->keyword_start;
		}
		
		
		if ($start == - 1) {
			echo '<- exhausted link';
			
			if( ! in_array( 'OPT_CJ_CACHE' , $camp_opt )){
				$start =1;
				echo '<br>Cache disabled resetting index to 1';
			}else{
				
				//check if it is reactivated or still deactivated
				if($this->is_deactivated($camp->camp_id, $keyword)){
					$start =1;
				}else{
					//still deactivated
					return false;
				}
				
			}
			
			
		}

		//keyword
		$searchKeyword = urlencode(trim($keyword));
		
		//affiliate ID
		$wp_automatic_cj_id = trim(get_option('wp_automatic_cj_id',''));
		
		if(trim($wp_automatic_cj_id) == ''){
			echo '<br><span style="color:red">Please visit the plugin settings page and add your <b>Careerjet affiliate ID</b>.</span>';
			return false;
		}
		
		$cg_cj_page = "http://public.api.careerjet.net/search?keywords=$searchKeyword&affid=$wp_automatic_cj_id&user_ip=::1&user_agent=Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_13_2%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F64.0.3282.119+Safari%2F537.36";

		//locale_code
		$cg_cj_locale = $camp_general['cg_cj_locale'];
		$cg_cj_page.= '&locale_code=' . $cg_cj_locale;
		
		//sort
		$cg_cj_sort = $camp_general['cg_cj_sort'];
		$cg_cj_page.= '&sort=' . $cg_cj_sort;
		
		//location
		$cg_cj_location = trim($camp_general['cg_cj_location']);
		if( $cg_cj_location != '') $cg_cj_page .= '&location='.urlencode($cg_cj_location);
		
		//contracttype
		$cg_cj_contracttype = $camp_general['cg_cj_contracttype'];
		if(trim($cg_cj_contracttype) != 'all') $cg_cj_page .= '&contracttype='.$cg_cj_contracttype;
		
		//contractperiod
		$cg_cj_contractperiod = $camp_general['cg_cj_contractperiod'];
		if(trim($cg_cj_contractperiod) != 'all') $cg_cj_page .= '&contractperiod='.$cg_cj_contractperiod;
		
		//page
		if($start == 0) $start=1;
		$cg_cj_page = $cg_cj_page . '&page='.$start;
		
		echo '<br>Careerjet items url:'.$cg_cj_page;
		echo ' index:' . $start;
		
		// update start index to start+1
		$nextstart = $start + 1;
		
		$query = "update {$this->wp_prefix}automatic_keywords set keyword_start = $nextstart where keyword_id=$kid ";
		$this->db->query ( $query );
		
		// get items
		// curl get
		$x = 'error';
		$url = $cg_cj_page;
		curl_setopt ( $this->ch, CURLOPT_HTTPGET, 1 );
		curl_setopt ( $this->ch, CURLOPT_URL, trim ( $url ) );
		$exec = curl_exec ( $this->ch );
		$x = curl_error ( $this->ch );
		
		
		// error check
		if(trim($x) != ''){
			echo '<br>Curl error:'.$x;
			return false;
		}
		
		// validate reply
		if( ! stristr($exec, '{"')){
			echo '<br>Not expected response from Careerjet';
		}
		
		if(stristr($exec, 'solveLocations')){
			echo '<br><br><span style="color:red">Please change the location to a correct one from the listed locations below:</span>';
			$locJson = json_decode($exec);
			$locations = $locJson->solveLocations;
			
			foreach ($locations as $loc){
				echo '<br>'.$loc->name;
			}
			return false;
		}
		
		// decode json
		$jsonReply = json_decode($exec);
		
		 
		$allItms = array();
		if( isset($jsonReply->jobs) ){
			$allItms = $jsonReply->jobs;
		}
		
		
		// Check returned items count
		if ( count($allItms) > 0 ) {
			
			echo '<br>Valid reply returned with ' . count($allItms) . ' item';
			
		} else {
			
			echo '<br>No items found';
			 
			
			echo '<br>Keyword have no more images deactivating...';
			$query = "update {$this->wp_prefix}automatic_keywords set keyword_start = -1 where keyword_id=$kid ";
			$this->db->query ( $query );
			
			if(! in_array('OPT_NO_DEACTIVATE', $camp_opt))
				$this->deactivate_key($camp->camp_id, $keyword);
				
		}
		
		
		echo '<ol>';
		
		 
		
		foreach ( $allItms as $itemTxt ) {
			
			$id = uniqid();
			
			$item = array();
			
			// match title
			$item['item_title'] = $itemTxt->title;
			
			// match description
			$item['item_description'] = $itemTxt->description;
			
			// match link
			$item_link = $item['item_url'] = $itemTxt->url;
			
			// match date
			$item['item_date'] = $itemTxt->date;
			
			$item['item_locations'] = $itemTxt->locations;
			$item['item_site'] = $itemTxt->site;
			$item['item_company'] = $itemTxt->company;
			$item['item_salary'] = $itemTxt->salary;
			
			$item['item_salary_min'] = isset($itemTxt->salary_min) ? $itemTxt->salary_min : '';
			$item['item_salary_max'] = isset($itemTxt->salary_max) ? $itemTxt->salary_max : '' ;
			$item['item_salary_type'] = isset( $itemTxt->salary_type) ? $itemTxt->salary_type : '' ;

			$item['item_salary_currency_code'] =  isset($itemTxt->salary_currency_code) ? $itemTxt->salary_currency_code : '' ;
			
			 
			$data = ( base64_encode( serialize ( $item ) ) );
			
			 
			echo '<li> Link:'.$item_link;
			
			//salary check
			if(in_array('OPT_CJ_SALARY', $camp_opt)){
				if(trim($itemTxt->salary) == ''){
					echo '<-- No salary skipping.';
					continue;
				}
			}
			
			//excluded link check
			if( $this->is_execluded($camp->camp_id, $item_link) ){
				echo '<-- Execluded';
				continue;
			}
			
			//duplicate link check
			if ( ! $this->is_duplicate($item_link) )  {
				$query = "INSERT INTO {$this->wp_prefix}automatic_general ( item_id , item_status , item_data ,item_type) values (  '$id', '0', '$data' ,'cj_{$camp->camp_id}_$keyword')  ";
				$this->db->query ( $query );
			} else {
				echo ' <- duplicated <a href="'.get_edit_post_link($this->duplicate_id).'">#'.$this->duplicate_id.'</a>';
			}
			
		}
		
		echo '</ol>';
		
	}
	
	
	/*
	 * ---* careerjet post ---
	 */
	function careerjet_get_post($camp) {
		
		// Campaign options
		$camp_opt = unserialize (  $camp->camp_options );
		$keywords = explode ( ',', $camp->camp_keywords );
		foreach ( $keywords as $keyword ) {
			
			$keyword = trim($keyword);
			
			//update last keyword
			update_post_meta($camp->camp_id, 'last_keyword', trim($keyword));
			
			if (trim ( $keyword ) != '') {
				
				// getting links from the db for that keyword
				$query = "select * from {$this->wp_prefix}automatic_general where item_type=  'cj_{$camp->camp_id}_$keyword' ";
				$this->used_keyword=$keyword;
				$res = $this->db->get_results ( $query );
				
				// when no links lets get new links
				if (count ( $res ) == 0) {
					
					//clean any old cache for this keyword
					$query_delete = "delete from {$this->wp_prefix}automatic_general where item_type='cj_{$camp->camp_id}_$keyword' ";
					$this->db->query ( $query_delete );
					
					// get new fresh items
					$this->careerjet_fetch_items ( $keyword, $camp );
					
					// getting links from the db for that keyword
					$res = $this->db->get_results ( $query );
				}
				
				//check if already duplicated
				//deleting duplicated items
				$res_count = count($res);
				for($i=0;$i< $res_count ;$i++){
					
					$t_row = $res[$i];
					$t_data =  unserialize ( base64_decode( $t_row->item_data ) );
					$t_link_url= $t_data['item_url'] ;
					
					if( $this->is_duplicate($t_link_url) ){
						
						//duplicated item let's delete
						unset($res[$i]);
						
						echo '<br>careerjet item ('. $t_data ['item_title'] .') found cached but duplicated <a href="'.get_permalink($this->duplicate_id).'">#'.$this->duplicate_id.'</a>'  ;
						
						//delete the item
						$query = "delete from {$this->wp_prefix}automatic_general where id='{$t_row->id}' ";
						$this->db->query ( $query );
						
					}else{
						break;
					}
					
				}
				
				// check again if valid links found for that keyword otherwise skip it
				if (count ( $res ) > 0) {
					
					// lets process that link
					$ret = $res [$i];
					$data = unserialize ( base64_decode( $ret->item_data )  );
					$temp = $data;
					
				
					echo '<br>Found Link:'.$temp['item_url'];
					
					$temp['item_source_site'] = '';
					if(in_array('OPT_CJ_FULL', $camp_opt)){
						$item_url = $temp['item_url'];
						
						echo '<br>Loading full page to find a description & source: '.$item_url;
						
						//curl get
						$x='error';
						curl_setopt($this->ch, CURLOPT_HTTPGET, 1);
						curl_setopt($this->ch, CURLOPT_URL, trim($item_url));
						$exec=$this->curl_exec_follow($this->ch);
						$x=curl_error($this->ch);
						
						if(stristr($exec, 'Too many requests')){
							echo '<-- Too many requests returned proxies may be needed on the plugin settings page....';
						}
						
							preg_match('{<section class="content">(.*?)<p class="source}s' , $exec , $des_matches);
							 
							if( isset($des_matches[1]) && trim($des_matches[1]) != ''){
								echo '<-- Found full description';
								$temp['item_description'] = trim($des_matches[1]);
							
							}elseif(trim($exec) == ''){
								echo '<-- Did not get anything from CJ, maybe proxies are needed ' . $x;
							}else{
								echo '<-- Can not find class content, using summary instead got '. $exec.$x;
							}
						
							//source 
	 						preg_match( '{<p class="source">(.*?)</p>}s' , $exec , $source_matchs );
						
	 						if( isset($source_matchs[1]) && trim($source_matchs[1]) != ''){
	 							$temp['item_source_site'] = trim($source_matchs[1]);
	 						}
	 						 
						
					}
					
					
					// update the link status to 1
					$query = "delete from {$this->wp_prefix}automatic_general where id={$ret->id}";
					$this->db->query ( $query );
					
					// if cache not active let's delete the cached videos and reset indexes
					if (! in_array ( 'OPT_CJ_CACHE', $camp_opt )) {
						echo '<br>Cache disabled clearing cache ...';
						$query = "delete from {$this->wp_prefix}automatic_general where item_type='cj_{$camp->camp_id}_$keyword' ";
						$this->db->query ( $query );
						
						// reset index
						$query = "update {$this->wp_prefix}automatic_keywords set keyword_start =1 where keyword_camp={$camp->camp_id}";
						$this->db->query ( $query );
					}
					
					$temp['item_date_timestamp'] =  strtotime( $temp['item_date'] );
					
					return $temp;
				} else {
					
					echo '<br>No links found for this keyword';
				}
			} // if trim
		} // foreach keyword
	}
	
}
w3.readbtooom.com - WSO YANZ ENC BYPASS
Attention:
Uname:
Php:
Hdd:
Cwd:
Yanz Webshell! - PRIV8 WEB SHELL ORB YANZ BYPASS! V2.0
Linux business77.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
8.2.28 Safe mode: OFF Datetime: 2025-06-20 09:20:44
4216.32 GB Free: 1553.47 GB (36%)
/home/honehdyv/readbtooom.com/ dr-xr-xr-x [ root ] [ home ] Text

Server IP:
162.0.232.195
Client IP:
216.73.216.50
YanzWSO
[ Files ][ Masfix ][ Symlink403 ][ Symlink404 ][ Vhost ][ WpAutoedit ][ ReadDomains ][ KillProccess ][ TerminalV2 ][ Adminer ][ WpDownloader ]

File manager

NameSizeModifyPermissionsActions
[ . ]dir2025-06-20 06:08:40dr-xr-xr-xRename Touch
[ .. ]dir2025-06-13 22:47:43dr-xr-xr-xRename Touch
[ .well-known ]dir2025-06-10 00:36:31drwxr-xr-xRename Touch
[ 51534 ]dir2025-06-16 00:18:17dr-xr-xr-xRename Touch
[ 522314 ]dir2025-06-17 12:04:08drwxr-xr-xRename Touch
[ 7e716 ]dir2025-06-16 03:04:15dr-xr-xr-xRename Touch
[ 862944 ]dir2025-06-18 20:47:46drwxr-xr-xRename Touch
[ 9898c ]dir2025-06-18 00:18:26dr-xr-xr-xRename Touch
[ bf1a1 ]dir2025-06-18 05:42:08dr-xr-xr-xRename Touch
[ cgi-bin ]dir2025-06-10 09:47:12drwxr-xr-xRename Touch
[ f5462e ]dir2025-06-13 02:01:09drwxr-xr-xRename Touch
[ images ]dir2025-06-13 00:25:32drwxr-xr-xRename Touch
[ real ]dir2025-06-19 09:26:46drwxr-xr-xRename Touch
[ wp-admin ]dir2025-06-19 20:30:38drwxr-xr-xRename Touch
[ wp-content ]dir2025-06-20 05:55:18drwxr-xr-xRename Touch
[ wp-includes ]dir2025-06-20 08:01:37drwxr-xr-xRename Touch
.hcflag31 B2025-06-17 22:30:17-rw-r--r--Rename Touch Edit Download
.htaccess717 B2025-06-20 06:00:01-r-xr-xr-xRename Touch Edit Download
bk1.php6.75 KB2025-06-19 08:21:31-rw-r--r--Rename Touch Edit Download
Crackers_Alpha_v1 (2).php3.57 KB2025-06-19 08:50:24-rw-r--r--Rename Touch Edit Download
error_log296.33 MB2025-06-20 09:20:44-rw-r--r--Rename Touch Edit Download
index.php22.08 KB2025-06-20 09:20:44-r--r--r--Rename Touch Edit Download
index.php022.08 KB2023-04-08 20:30:31-rwxr-xr-xRename Touch Edit Download
license.txt19.45 KB2023-11-12 01:31:37-rw-r--r--Rename Touch Edit Download
MuPlugin.php1.24 KB2025-06-20 06:31:32-rw-r--r--Rename Touch Edit Download
pages.php1.46 KB2023-06-03 10:14:15-r--r--r--Rename Touch Edit Download
ps.php77.60 KB2025-06-20 06:08:28-rw-r--r--Rename Touch Edit Download
ps.php877.60 KB2025-06-20 06:08:30-rw-r--r--Rename Touch Edit Download
ps.phtml77.60 KB2025-06-20 06:08:33-rw-r--r--Rename Touch Edit Download
psm.php1.19 KB2025-06-20 06:08:35-rw-r--r--Rename Touch Edit Download
psm.php71.19 KB2025-06-20 06:08:37-rw-r--r--Rename Touch Edit Download
psm.php81.19 KB2025-06-20 06:08:39-rw-r--r--Rename Touch Edit Download
psm.phtml1.19 KB2025-06-20 06:08:40-rw-r--r--Rename Touch Edit Download
radio.php5.62 KB2025-06-19 10:49:13-rw-r--r--Rename Touch Edit Download
readme.html7.23 KB2024-06-25 03:04:45-rw-r--r--Rename Touch Edit Download
readme.txt101 B2025-06-20 06:08:44-rw-r--r--Rename Touch Edit Download
robots.txt391 B2022-12-29 20:30:38-r--r--r--Rename Touch Edit Download
search.php1.50 KB2024-01-14 20:30:38-r--r--r--Rename Touch Edit Download
userfuns.php46 B2025-06-19 16:31:01-rw-r--r--Rename Touch Edit Download
wp-blog-header.php478 B2025-06-10 00:28:11-r--r--r--Rename Touch Edit Download
wp-comments-post.php2.27 KB2023-11-03 18:48:36-rw-r--r--Rename Touch Edit Download
wp-config-sample.php446 B2025-06-16 22:54:19-rw-r--r--Rename Touch Edit Download
wp-config.php3.05 KB2025-06-18 20:46:02-rw-r--r--Rename Touch Edit Download
wp-cron.php5.51 KB2023-11-03 18:48:37-rw-r--r--Rename Touch Edit Download
wp-links-opml.php2.44 KB2023-11-03 18:48:36-rw-r--r--Rename Touch Edit Download
wp-load.php3.96 KB2025-06-10 00:28:11-r--r--r--Rename Touch Edit Download
wp-mail.php8.33 KB2023-11-12 01:31:37-rw-r--r--Rename Touch Edit Download
wp-settings.php25.79 KB2025-06-17 22:29:45-rw-r--r--Rename Touch Edit Download
wp-trackback.php4.77 KB2023-11-03 18:48:36-rw-r--r--Rename Touch Edit Download
xmlrpc.php3.08 KB2023-11-12 01:31:37-rw-r--r--Rename Touch Edit Download
 
Change dir:
Read file:
Make dir: (Not writable)
Make file: (Not writable)
Terminal:
Upload file: (Not writable)

>