Skip to content
컴퓨터잡담
2009.08.05 14:16

네이버 만화 PHP로 RSS 출력 만들기

조회 수 31787 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

네이버 만화 PHP로 RSS 출력 만들기


참고사이트 : http://comic.naver.com/main.nhn?order=StarScore


RSS 수집을 하기위해 PHP로 RSS출력하는 소스를 만들어 보았습니다.


출력 내용은 제목, 링크주소,내용(이미지) 3개로 구성했습니다.


우선 제로보드 XE의 수집기가 description안에 이미지를 찾아서 등록시키는 것으로


내용에 이미지를 넣었습니다만, 이미지를 별도로 하고 싶으시면


수정하시면 되겠죵?~ ㅋㅋㅋ;;






잘 나오는 것 같습니다.



만화 괜찮은 사이트 없나요? 쩝...


소스내용이 크롬에서는 잘보이는데 익스프롤러에서는 제대로 나오는지 모르겟습니다.


//=======================================================================================


<?
$now=time();

$a = file('http://comic.naver.com/main.nhn?order=StarScore');

$bae = 0;

for($i=0;$i<count($a);$i++)
 {$a[$i] = iconv("utf-8","euc-kr",$a[$i]);
 if(ereg('<h4 class="subtlt"><img src="./,$a[$i]) $cc = 1;
 if(ereg("<div class="cutTypeChal"><span>',$a[$i])) $cc = 0;

 if($cc == 1)
  {

  if(ereg('img src="./,$a[$i]) && ereg("a onclick',$a[$i]))
    {
    $imga = explode('img src="./,$a[$i]);
    $imga = explode(""',$imga[1]);
    $img[$bae] = $imga[0];
//    echo '<br />'.$bae.$img[$bae].'<br />';

    $linka = explode('href="./,$a[$i]);
    $linka = explode(""><img',$linka[1]);
    $link[$bae] = $linka[0];

    $titlea = explode('title="',$a[$i]);
    $titlea = explode('" w',$titlea[1]);
    $title[$bae] = $titlea[0];

//    echo $link[$bae];
//    echo $title[$bae];

    $bae++;
    }
  }
 } //for_end

 


$a = file('http://comic.naver.com/main.nhn?order=ViewCount');


for($i=0;$i<count($a);$i++)
 {$a[$i] = iconv("utf-8","euc-kr",$a[$i]);
 if(ereg('<h4 class="subtlt"><img src="./,$a[$i]) $cc = 1;
 if(ereg("<div class="cutTypeChal"><span>',$a[$i])) $cc = 0;

 if($cc == 1)
  {

  if(ereg('img src="./,$a[$i]) && ereg("a onclick',$a[$i]))
    {
    $imga = explode('img src="./,$a[$i]);
    $imga = explode(""',$imga[1]);
    $img[$bae] = $imga[0];
//    echo '<br />'.$bae.$img[$bae].'<br />';

    $linka = explode('href="./,$a[$i]);
    $linka = explode(""><img',$linka[1]);
    $link[$bae] = $linka[0];

    $titlea = explode('title="',$a[$i]);
    $titlea = explode('" w',$titlea[1]);
    $title[$bae] = $titlea[0];

//    echo $link[$bae];
//    echo $title[$bae];

    $bae++;
    }
  }
 } //for_end


//header('Content-Type: text/xml; charset=euc-kr');

$content .= '<?xml version="1.0"?>'.chr(13);
$content .= '<rss version="2.0"><channel xmlns:psl="http://rainbow.daum.net/psl"> '.chr(13);
$content .= '<title>네이버 만화</title> '.chr(13);
$content .= '<link>http://k.daum.net/qna/openknowledge/list.html?category_id=D</link> '.chr(13);
$content .= '<description>다음지식 오픈사전</description> '.chr(13);
$content .= '<pubDate></pubDate> '.chr(13);
$content .= '<language>ko</language> '.chr(13);
$content .= '<copyright>Copyright (c) Daum Communications. All rights reserved.</copyright> '.chr(13);
$content .= '<webMaster>wwwmaster@hanmail.net</webMaster> '.chr(13);
$content .= '<generator>Daum CMS</generator> '.chr(13);
$content .= '<docs></docs> '.chr(13);
$content .= '<ttl>18</ttl> '.chr(13);
$content .= '<image> '.chr(13);
$content .= '<url>http://image.daum-img.net/hanmail/top/2005f_top/daum.gif</url> '.chr(13);
$content .= '<title>Naver RSS</title> '.chr(13);
$content .= '<link>http://www.naver.com</link>'.chr(13);
$content .= '</image>'.chr(13);

 


for($i=0;$i<count($title);$i++)
 {

  $content .= '  <item>'.chr(13);

  $content .= '  <title>'.$title[$i].'</title>'.chr(13);
  $content .= '  <link>http://comic.naver.com'.htmlspecialchars($link[$i]).'</link>'.chr(13);
  $content .= '  <description>'.$title[$i].'&lt;img src="./&quot;".$img[$i].'&quot;&gt;</description>'.chr(13);

  $cate = explode(',',$tag[$i]);

  if($cate[0]) {$content .= '  <category>'.$cate[0].'</category>'.chr(13);}
  if($cate[1]) {$content .= '  <category>'.$cate[1].'</category>'.chr(13);}
  if($cate[2]) {$content .= '  <category>'.$cate[2].'</category>'.chr(13);}
  if($cate[3]) {$content .= '  <category>'.$cate[3].'</category>'.chr(13);}
  if($cate[4]) {$content .= '  <category>'.$cate[4].'</category>'.chr(13);}

//  for($ii=0;$ii<count($cate);$i++)
//   { echo '<category>'.$cate[$ii].'</category>'; }


  $content .= '  </item>'.chr(13).chr(13);
 }//for_end

 


$content .= '</channel>'.chr(13);
$content .= '</rss>'.chr(13);


print $content;


// $file_pointer = fopen("../../temp/daum_man_rss.xml", "w");
// $context = $content;
// fwrite($file_pointer, $context);
// fclose($file_pointer);

?>

로그인 후 댓글쓰기가 가능합니다.

?

  1. 19
    Nov 2009
    08:35

    mysql 재시작, 사용자 추가 명령어

    Category컴퓨터잡담 Views32229
    Read More
  2. 13
    Feb 2011
    21:37

    reader_sl.exe , AdobeARM.exe 프로세스 삭제방법

    Category프로세스 Views32054
    Read More
  3. 24
    Aug 2009
    09:09

    MySQL TABLE 손상시 대응방법(db 내용이 안 나올때)

    Category컴퓨터잡담 Views31833
    Read More
  4. 05
    Aug 2009
    14:16

    네이버 만화 PHP로 RSS 출력 만들기

    Category컴퓨터잡담 Views31787
    Read More
  5. 07
    Aug 2009
    21:15

    컴퓨터 OS부팅도 이젠 초고속 전쟁이다.

    Category컴퓨터잡담 Views31754
    Read More
  6. 20
    Sep 2010
    18:00

    엑셀에서 날짜와 시간 계산하는 법

    Category컴퓨터잡담 Views31664
    Read More
  7. 04
    Oct 2011
    09:46

    VBA - 시트/셀, 엑셀 값만 복사하기! (VBA을 이용한 복사영역 조절)

    Category컴퓨터잡담 Views31418
    Read More
  8. 08
    Jun 2022
    08:47

    자바스크립트 종말각?! HTML에서 파이썬 실행하는 PyScript 등장!

    Category파이썬 Views31256
    Read More
  9. 05
    Jan 2012
    07:01

    Excel Vba) 현재 셀에서 한줄내림 (activecell.offset(1,0).Select)

    CategoryExcel Views31019
    Read More
  10. 05
    Aug 2009
    12:55

    네이버, 다음지식 php로 RSS 출력 만들기

    Category컴퓨터잡담 Views31009
    Read More
  11. 10
    Apr 2011
    12:46

    PF사용...페이징 중지를 통한 시스템 성능개선

    Category프로세스 Views30889
    Read More
  12. 23
    Oct 2011
    06:07

    eXCEL VBA)엑셀파일 열지않고 내용 불러오기

    Category컴퓨터잡담 Views30517
    Read More
  13. 06
    Mar 2012
    08:34

    autohotkey) 윈도우 ahk_id 추출하기

    CategoryAutoHotKey Views30088
    Read More
  14. 12
    Mar 2010
    19:37

    rss리더기

    Category컴퓨터잡담 Views29915
    Read More
  15. 11
    Nov 2014
    08:12

    Google Spreadsheet (Docs) 에서 우리은행 환율정보 이용하기

    Category[Docs]스프레드시트 Views29869
    Read More
  16. 17
    Mar 2010
    13:35

    한글 HEX 코드표

    Category컴퓨터잡담 Views29525
    Read More
  17. 21
    Dec 2011
    14:36

    Excel) 엑셀 콤보박스 대화상자 목록지정하기

    CategoryExcel Views29390
    Read More
  18. 14
    Oct 2011
    13:54

    Excel VBA) 원하는 범위 지정한 뒤 복사하여 붙여넣기

    Category컴퓨터잡담 Views29385
    Read More
  19. 30
    Jun 2009
    15:37

    curl로 다음 자동로그인 가능하다.

    Category컴퓨터잡담 Views28914
    Read More
  20. 13
    Mar 2012
    23:06

    autohotkey) 편입 변수

    CategoryAutoHotKey Views28888
    Read More
Board Pagination Prev 1 2 3 4 5 6 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소