돌아온헌이

m3cron이용해 홈페이지 게스트를 유입 하려고 이런짖을 하였지만....

· 2018-02-22 (목) 12:31:48 · 3008 · 7

 

로봇만  키우는 신세가 되었다 

 

해당코드는 이러하다 

 

<?php 
include_once('./_common.php'); 


function insert_write($newpost) 

global $g5; 

//게시판 테이블 정보 
$bo_table = $newpost[bo_table]; 
if(!strlen($bo_table)) return FALSE; //bo_table 값이 지정되지 않았습니다. 
$board = sql_fetch(" select * from {$g5['board_table']} where bo_table = '$bo_table' "); 
if(!$board) return FALSE; //bo_table이 존재하지 않습니다. 

//회원정보 및 권한 확인 
    $member = get_member($newpost[mb_id]); 
    if(!$member) return FALSE; //mb_id가 존재하지 않습니다. 
    //if($board[bo_write_level] > $member[mb_level]) return FALSE; //글쓰기 권한이 없습니다. 

//카테고리 설정 
    $ca_name = $newpost[ca_name]; 
if ($ca_name && strpos($board[bo_category_list], $ca_name) === FALSE){ 
$category_list = $board[bo_category_list]."|".$ca_name; 
$sql = " update {$g5['board_table']} set bo_category_list = '$category_list' where bo_table = '$bo_table' "; 
sql_query($sql); 


//변수 정리 
    $write_table = $g5[write_prefix].$bo_table; 
    $wr_num = get_next_num($write_table); 
    $ca_name = addslashes($ca_name); 
    $html = "html1"; 
    $secret = ""; 
    $mail = ""; 
    $wr_subject = addslashes(trim($newpost[wr_subject])); 
    $wr_content = addslashes(trim($newpost[wr_content])); 
    if(!$wr_subject) return FALSE; //글 제목이 없습니다. 
    if(!$wr_content) return FALSE; //글 내용이 없습니다. 
    $mb_id = $member[mb_id]; 
    $wr_password = $member[mb_password]; 
    $wr_name = $board[bo_use_name] ? $member[mb_name] : $member[mb_nick]; 
$wr_email = $member[mb_email]; 
$wr_homepage = $member[mb_homepage]; 
    for($i=1; $i<=10; $i++){ 
        $wr = "wr_{$i}"; 
        ${$wr} = addslashes($newpost[$wr]); 
    } 
    $wr_link1 = $newpost[wr_link1]; 
    $wr_link2 = $newpost[wr_link2]; 

//글 입력하기 
$sql = " insert into $write_table 
                set wr_num = '$wr_num', 
                    wr_reply = '', 
                    wr_comment = 0, 
                    ca_name = '$ca_name', 
                    wr_option = '$html,$secret,$mail', 
                    wr_subject = '$wr_subject', 
                    wr_content = '$wr_content', 
                    wr_link1 = '$wr_link1', 
                    wr_link2 = '$wr_link2', 
                    wr_link1_hit = 0, 
                    wr_link2_hit = 0, 
                    wr_hit = 0, 
                    wr_good = 0, 
                    wr_nogood = 0, 
                    mb_id = '$mb_id', 
                    wr_password = '$wr_password', 
                    wr_name = '$wr_name', 
                    wr_email = '$wr_email', 
                    wr_homepage = '$wr_homepage', 
                    wr_datetime = '".G5_TIME_YMDHIS."', 
                    wr_last = '".G5_TIME_YMDHIS."', 
                    wr_ip = '{$_SERVER['REMOTE_ADDR']}', 
                    wr_1 = '$wr_1', 
                    wr_2 = '$wr_2', 
                    wr_3 = '$wr_3', 
                    wr_4 = '$wr_4', 
                    wr_5 = '$wr_5', 
                    wr_6 = '$wr_6', 
                    wr_7 = '$wr_7', 
                    wr_8 = '$wr_8', 
                    wr_9 = '$wr_9', 
                    wr_10 = '$wr_10' "; 
    sql_query($sql); 

    $wr_id = mysql_insert_id(); 

    sql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' "); //부모 아이디에 UPDATE 
sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$bo_table}', '{$wr_id}', '{$wr_id}', '".G5_TIME_YMDHIS."', '$mb_id' ) "); //새글 INSERT    
    sql_query(" update {$g5['board_table']} set bo_count_write = bo_count_write + 1 where bo_table = '{$bo_table}' "); //게시글 1 증가 

return array('bo_table' => $bo_table, 'wr_id' => $wr_id, 'sca' => $ca_name); 
//return TRUE; 



$array = array('http://feeds.feedburner.com/inews', 'http://www.chosun.com/site/data/rss/video.xml', 'http://photo.chosun.com/site/data/rss/photonews.xml', 'http://www.top-rider.com/rss/clickTop.xml', 'http://rss.etnews.com/Section902.xml', 'http://rss.etnews.com/Section903.xml', 'http://rss.etnews.com/Section904.xml');//url 랜덤처리 
$randNum = rand(0,count($array)-1); 


$bo_table = 'rss_news'; //게시판 테이블 
$write_table = $g5[write_prefix].$bo_table; 
$url1 = $array[$randNum]; //RSS 

require(G5_LIB_PATH.'/Snoopy.class.php'); 
ini_set("allow_url_fopen","1"); 

$snoopy = new Snoopy; 
$snoopy->fetch($url1); 
$xml = @simplexml_load_string($snoopy->results); 
foreach($xml->channel->item as $item) {
$sql = "select count(*) as cnt from $write_table where wr_link1 = '".$item->link."' and wr_is_comment = 0"; 
$row = sql_fetch($sql); 
if ($row['cnt'] == 0){ 
    
$newpost = array( 
'mb_id' => 'admin', 
'bo_table' => $bo_table, 
'wr_subject' => $item->title, 
'wr_content' => $item->description."...<br><br>... [<a target='_blank' href='".$item->link."'>더보기</a>]", 
'wr_link1' => $item->link 
); 
$result = insert_write($newpost); 
}

?> 

xml파싱하여 뉴스를 긇어오는 과정이다 

아무리 봐도 문제가 있어보인다... 

 

 

|

댓글 7개

개발자 메모장 오픈 축하드립니다.
2018-02-22 (목) 14:08:17
긁어오는 로봇이군요. 작년 여름에 수백만건의 유머, 게시판 등을 자동으로 가져왔더니 정작 활용하려니 너무 많은 자료를 분별할수 없어서 포기했죠..ㅠ
2018-02-22 (목) 23:57:54
개발자 메모장 답네요!
좋습니다. 대박 나시길 기원합니다. ~~
소지구는 어쩌다 저 모양이 되었지만
개발자 메모장은 제대로 갔으면 좋겠어요. ㅎㅎ
@소지구 참네 형님은 소심쟁이 ㅋㅋㅋ
2018-02-23 (금) 07:27:43
@헌이 이런 틀켰다! ㅋㅋ
@소지구 즐거운 주말 되세요
2018-02-24 (토) 10:55:36
@헌이 네에 ~~ 헌이님께서도 즐거운 주말 되세요!!!
댓글을 작성하시려면 로그인이 필요합니다.

개발자 메모장

30건
+
제목 글쓴이 날짜 조회
20-04-09 조회 2,478
20-01-23 조회 4,694
19-02-11 조회 3,761
19-01-28 조회 2,934
19-01-27 조회 1,952
19-01-10 조회 2,464
18-11-05 조회 2,090
18-11-05 조회 3,382
18-11-05 조회 1,867
18-04-17 조회 2,958
18-03-31 조회 7,452
18-03-29 조회 1.2만
18-03-19 조회 1,928
18-03-15 조회 3,462
18-03-15 조회 1.9만
18-03-12 조회 3,305
18-03-10 조회 2,258
18-03-04 조회 3,445
18-03-03 조회 2,142
18-02-28 조회 2,320
18-02-27 조회 3,181
18-02-26 조회 2,046
18-02-25 조회 1,975
18-02-24 조회 2,330
18-02-24 조회 2,652
18-02-23 조회 2,158
18-02-23 조회 2,502
18-02-23 조회 2,419
18-02-22 조회 2,517
18-02-22 조회 3,009