링크
http://www.shotbirdie.com/contents/bbs/board.php?bo_table=B16 (407) http://www.shotbirdie.com/contents/bbs/board.php?bo_table=invest_qna (380)
http://www.shotbirdie.com/contents/bbs/board.php?bo_table=B16
http://www.shotbirdie.com/contents/bbs/board.php?bo_table=invest_qna
http://www.shotbirdie.com/contents/bbs/board.php?bo_table=daum_jisik
골프, 재테크 2개의 지식인 게시물을 운영하고 있습니다.
분류별로 나와있는 다음 지식인 RSS(질문)를 m3cron을 활용하여
매일 update하고 있습니다.
그러면 질문만 게시물에 덩그러니 있겠죠?
해당게시물의 다음지식인 답변을 파싱해서 자동으로 답변글을
insert해주는 소스입니다.
간단히 말하면 지식인 답변 파싱소스구요~
활용방법은 무궁무진합니다.
다음의 해당 분류별 지식인이 있으니까 말이죠~
자신의 홈페이지 성격에 맞는 게시글 RSS파싱후 답변을 또 자동으로
파싱처리 합니다.
글등록 답변이 이루어 지는 사이 저는 손하나 까딱안합니다.
뭐 제 사이트 99%가 다 그런식이죠~
답변은 사절이구요~
해당 소스 바로 뿌립니다~
include_once './lib/Snoopy.class.php';
//13.02.25 추가(지식인 답변을 파싱해서 자동insert시킴)
$q = "select * from g4_write_invest_qna where ca_name = '다음지식人' and wr_link1 != '' and wr_4 = '' and wr_5 != 'wr_4_ok' order by wr_id";
$r = @mysql_query($q);
while($d = @mysql_fetch_array($r)){
$site_url = "$d[wr_link1]";
$snoopy=new snoopy;
$snoopy->fetch($site_url);
$txt = $snoopy->results;
$txt=iconv("euc-kr","UTF-8",$txt);
$ex = explode("<!-- 상세 내용 -->",$txt);
for($i=1;$i<sizeof($ex);$i++){
$ex2 = explode("<!-- //상세 내용 -->",$ex[$i]);
$wr_4[$i] = "<br><font color='black'><b>답변[$i]</b></font><br>$ex2[0]";
$wr_4[$i] = strip_tags($wr_4[$i]);
$wr_4[$i] = nl2br($wr_4[$i]);
//기존 wr_4값 호출
$q2 = "select wr_4 from g4_write_invest_qna where wr_id='$d[wr_id]'";
$r2 = @mysql_query($q2);
$wr_4bk = @mysql_result($r2,0,0);
$q1 = "update g4_write_invest_qna set wr_4 = CONCAT('$wr_4bk','<br><br>','$wr_4[$i]'), wr_5 = 'wr_4_ok' where wr_id='$d[wr_id]'";
@mysql_query($q1);
}
}
http://www.shotbirdie.com/contents/bbs/board.php?bo_table=invest_qna
http://www.shotbirdie.com/contents/bbs/board.php?bo_table=daum_jisik
골프, 재테크 2개의 지식인 게시물을 운영하고 있습니다.
분류별로 나와있는 다음 지식인 RSS(질문)를 m3cron을 활용하여
매일 update하고 있습니다.
그러면 질문만 게시물에 덩그러니 있겠죠?
해당게시물의 다음지식인 답변을 파싱해서 자동으로 답변글을
insert해주는 소스입니다.
간단히 말하면 지식인 답변 파싱소스구요~
활용방법은 무궁무진합니다.
다음의 해당 분류별 지식인이 있으니까 말이죠~
자신의 홈페이지 성격에 맞는 게시글 RSS파싱후 답변을 또 자동으로
파싱처리 합니다.
글등록 답변이 이루어 지는 사이 저는 손하나 까딱안합니다.
뭐 제 사이트 99%가 다 그런식이죠~
답변은 사절이구요~
해당 소스 바로 뿌립니다~
include_once './lib/Snoopy.class.php';
//13.02.25 추가(지식인 답변을 파싱해서 자동insert시킴)
$q = "select * from g4_write_invest_qna where ca_name = '다음지식人' and wr_link1 != '' and wr_4 = '' and wr_5 != 'wr_4_ok' order by wr_id";
$r = @mysql_query($q);
while($d = @mysql_fetch_array($r)){
$site_url = "$d[wr_link1]";
$snoopy=new snoopy;
$snoopy->fetch($site_url);
$txt = $snoopy->results;
$txt=iconv("euc-kr","UTF-8",$txt);
$ex = explode("<!-- 상세 내용 -->",$txt);
for($i=1;$i<sizeof($ex);$i++){
$ex2 = explode("<!-- //상세 내용 -->",$ex[$i]);
$wr_4[$i] = "<br><font color='black'><b>답변[$i]</b></font><br>$ex2[0]";
$wr_4[$i] = strip_tags($wr_4[$i]);
$wr_4[$i] = nl2br($wr_4[$i]);
//기존 wr_4값 호출
$q2 = "select wr_4 from g4_write_invest_qna where wr_id='$d[wr_id]'";
$r2 = @mysql_query($q2);
$wr_4bk = @mysql_result($r2,0,0);
$q1 = "update g4_write_invest_qna set wr_4 = CONCAT('$wr_4bk','<br><br>','$wr_4[$i]'), wr_5 = 'wr_4_ok' where wr_id='$d[wr_id]'";
@mysql_query($q1);
}
}
댓글 17개
게시글 목록
| 번호 | 제목 |
|---|---|
| 34292 | |
| 34279 | |
| 34278 | |
| 34264 | |
| 34251 | |
| 34231 | |
| 34196 | |
| 34184 | |
| 34166 | |
| 34151 | |
| 34143 | |
| 34142 | |
| 34134 | |
| 34132 | |
| 34131 | |
| 34125 | |
| 34093 | |
| 34076 | |
| 34060 | |
| 34031 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기