Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
nonga.eemo.co.kr
/
public_html
/
www
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/nonga.eemo.co.kr/public_html/www/crontab_croll_cc_sise.php
<? session_cache_limiter('no-cache, must-revalidate'); session_start(); header("Pragma: no-cache"); header("Cache-Control: no-cache,must-revalidate"); header("Content-Type: text/html; charset=utf-8"); session_cache_limiter('no-cache, must-revalidate'); session_start(); $wshome="/home/nonga.eemo.co.kr/public_html/www"; $WSSERIP="127.0.0.1"; include_once($wshome."/dbconn.php"); include_once($wshome."/lib.php"); include ("simple_html_dom.php"); ini_set('max_execution_time',3600); foreach($_GET as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } foreach($_POST as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } $url = 'https://www.poultry.or.kr'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8'); //curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close ($ch); $html=str_get_html($response); //echo $response; $rtn=array(); $prev=""; $res=array(); foreach($html->find('table[class=t_price]') as $element) { $nn2=1; foreach($element->find('tr') as $el3) { if($nn==0) { $col=1; foreach($el3->find('th') as $el6) { $vv_data6=strip_tags(trim(strtolower($el6)),""); $vv_data6=str_replace("\t","",$vv_data6); $vv_data6=trim($vv_data6); if($vv_data6) { if($col==1) { $rtn['jdate']=date('Y-').date('m-d',strtotime($vv_data6)); } //echo $col."/".$vv_data6."<br>"; } $col++; } } else { $col=1; foreach($el3->find('td') as $el4) { $vv_data=strip_tags(trim(strtolower($el4)),""); $vv_data=str_replace("\t","",$vv_data); $vv_data=trim($vv_data); echo $nn2."/".$vv_data."<br>"; if($nn2==1) { $rtn['v1']=str_replace(",","",$vv_data); } else if($nn2==5) { $rtn['v2']=str_replace(",","",$vv_data); } else if($nn2==9) { $rtn['v3']=str_replace(",","",$vv_data); } else if($nn2==13) { $rtn['v4']=str_replace(",","",$vv_data); } /* if(mb_strpos($vv_data,"거래일",0, "utf-8") !== false) { $vv0=mb_substr($vv_data, mb_strlen("거래일")); echo $vv0."<br>"; } */ if($vv_data) { //echo $col."/".$vv_data."<br>"; } $col++; $nn2++; } } $nn++; $row++; } } $is_rs=RS("select * from bro_cc_sise where jdate='{$rtn['jdate']}' and type='poultry' "); if(!$is_rs[no]) { $query="insert into bro_cc_sise set jdate='{$rtn['jdate']}', v1='{$rtn['v1']}', v2='{$rtn['v2']}', v3='{$rtn['v3']}', v4='{$rtn['v4']}', type='poultry', uptime=now() "; mysql_query($query) or die(); } ?>