건

구글 API를 활용한 뉴스 목록 가져오기

<html>
<head>
    <title>http://www.blueb.co.kr</title>

<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAdV0OihhLfo4ru8N1BXzlWxSJ87f2VNqmObhB7kj4DJwDOGkiiBR3Nh79Pxxmk0DgEb3TTwZHI-Fp1g"></script>
<script type="text/javascript" src="http://www.blueb.co.kr/SRC/javascript/js/gfeedfetcher.js"></script>
<style type="text/css">
.labelfield{ /*CSS for label field in general*/
color:brown;
font-size: 90%;
}

.datefield{ /*CSS for date field in general*/
color:gray;
font-size: 90%;
}

#example1 li{ /*CSS specific to demo 1*/
margin-bottom: 4px;
}

#example2 div{ /*CSS specific to demo 2*/
margin-bottom: 5px;
}

#example2 div a{ /*CSS specific to demo 2*/
text-decoration: none;
}

#example3 a{ /*CSS specific to demo 3*/
color: #D80101;
text-decoration: none;
font-weight: bold;
}

#example3 p{ /*CSS specific to demo 3*/
margin-bottom: 2px;
}

code{ /*CSS for insructions*/
color: red;
}
</style>
</head>
</body>


<b>Example 1: (Single RSS feed, 10 entries, "<code>date</code>" field enabled, sort by <code>title</code>)</b><p>
<a href="javascript:cssfeed.init()"><B>본 항목을 새로고침</B></a><br>
<script type="text/javascript">
var cssfeed=new gfeedfetcher("example1", "example1class", "")
    cssfeed.addFeed("문화일보", "http://news.naver.com/rss/rss_presscenter.nhn?office_id=021") //RSS주소 및 제목
    cssfeed.displayoptions("date") //날짜 필드 보여주기
    cssfeed.setentrycontainer("li") //정렬은 Li태그로
    cssfeed.filterfeed(10, "title") //목록은 10개
    cssfeed.init() //Always call this last
</script>
<br><br>

<b>Example 2: (Two RSS feeds, 6 entries, "<code>label"</code>, "<code>datetime</code>", and "<code>snippet</code>" fields enabled, sort by <code>label</code>)</b><p>
<a href="javascript:socialfeed.init()"><B>본 항목을 새로고침</B></a><br>
<script type="text/javascript">
var socialfeed=new gfeedfetcher("example2", "example2class", "_new")
    socialfeed.addFeed("동아일보", "http://news.naver.com/rss/rss_presscenter.nhn?office_id=020") //Specify "label" plus URL to RSS feed
    socialfeed.addFeed("조선일보", "http://news.naver.com/rss/rss_presscenter.nhn?office_id=023") //Specify "label" plus URL to RSS feed
    socialfeed.displayoptions("label datetime snippet") //show the specified additional fields
    socialfeed.setentrycontainer("div") //Display each entry as a DIV
    socialfeed.filterfeed(6, "label") //Show 6 entries, sort by label
    socialfeed.init() //Always call this last
</script>
<br><br>

 

<b>Example 3: (Three RSS feeds, 8 entries, "<code>datetime</code>" and "<code>snippet</code>" fields enabled, sort by <code>date</code>)</b><p>
<a href="javascript:newsfeed.init()"><B>본 항목을 새로고침</B></a><br>

<script type="text/javascript">
var newsfeed=new gfeedfetcher("example3", "example3class", "_new")
    newsfeed.addFeed("서울신문", "http://news.naver.com/rss/rss_presscenter.nhn?office_id=081") //Specify "label" plus URL to RSS feed
    newsfeed.addFeed("한겨레", "http://news.naver.com/rss/rss_presscenter.nhn?office_id=028") //Specify "label" plus URL to RSS feed
    newsfeed.addFeed("중앙일보", "http://news.naver.com/rss/rss_presscenter.nhn?office_id=025") //Specify "label" plus URL to RSS feed
    newsfeed.displayoptions("datetime snippet") //show the specified additional fields
    newsfeed.setentrycontainer("p") //Display each entry as a paragraph
    newsfeed.filterfeed(8, "date") //Show 8 entries, sort by date
    newsfeed.init() //Always call this last
</script>


</body>
</html>

[이 게시물은 관리자님에 의해 2011-10-31 16:49:28 Prototype에서 이동 됨]

첨부파일

gfeedfetcher.js (5.7 KB) 146회 2008-04-17 10:24

댓글 3개

좋은 자료네요.. 감사드려요^^
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,187건
+
제목 글쓴이 날짜 조회
07-04-22 조회 2,612
07-04-22 조회 2,439
07-04-22 조회 2,360
07-04-21 조회 2,429
07-04-21 조회 2,756
07-04-21 조회 2,103
07-04-21 조회 2,526
07-04-21 조회 2,360
07-04-21 조회 2,437
07-04-20 조회 4,254
07-04-20 조회 2,160
07-04-20 조회 2,382
07-04-20 조회 3,419
07-04-20 조회 3,524
07-04-20 조회 2,546
07-04-20 조회 3,151
07-04-20 조회 2,409
07-04-19 조회 3,765
07-04-18 조회 7,838
07-04-18 조회 5,042
07-04-18 조회 3,440
07-04-17 조회 7,592
07-04-17 조회 3,856
07-04-17 조회 3,896
07-04-17 조회 3,341
07-04-16 조회 3,356
07-04-16 조회 3,341
07-04-16 조회 5,212
07-04-15 조회 5,267
07-04-15 조회 6,339
07-04-14 조회 5,438
07-04-13 조회 3,865
07-04-13 조회 3,182
07-04-13 조회 4,138
07-04-13 조회 3,998
07-04-13 조회 3,495
07-04-12 조회 6,691
07-04-12 조회 6,037
07-04-12 조회 5,096
07-04-12 조회 4,693
07-04-12 조회 3,377
07-04-12 조회 3,413
07-04-12 조회 4,933
07-04-11 조회 3,537
07-04-11 조회 3,740
07-04-11 조회 2,982
07-04-11 조회 5,773
07-04-11 조회 3,387
07-04-11 조회 3,510
07-04-11 조회 5,266
07-04-08 조회 5,250
07-04-07 조회 3,341
07-04-05 조회 4,027
07-04-05 조회 6,403
07-04-04 조회 3,631
07-04-04 조회 4,206
07-04-02 조회 9,843
07-03-31 조회 3,234
07-03-31 조회 4,212
07-03-30 조회 3,849
07-03-30 조회 4,222
07-03-29 조회 3,682
07-03-29 조회 3,730
07-03-27 조회 3,976
07-03-27 조회 5,194
07-03-27 조회 3,890
07-03-26 조회 3,948
07-03-24 조회 4,473
07-03-24 조회 4,080
07-03-23 조회 3,321
07-03-22 조회 3,745
07-03-21 조회 3,777
07-03-21 조회 5,279
07-03-21 조회 6,007
07-03-20 조회 3,602
07-03-20 조회 3,783
07-03-20 조회 3,675
07-03-20 조회 5,020
07-03-19 조회 3,653
07-03-19 조회 3,570
07-03-18 조회 2,893
07-03-18 조회 3,190
07-03-18 조회 4,022
07-03-18 조회 4,767
07-03-17 조회 4,272
07-03-16 조회 4,170
07-03-16 조회 3,201
07-03-15 조회 5,339
07-03-15 조회 3,417
07-03-13 조회 5,435
07-03-13 조회 3,733
07-03-13 조회 3,620
07-03-13 조회 4,729
07-03-13 조회 3,459
07-03-13 조회 3,347
07-03-12 조회 4,504
07-03-11 조회 5,189
07-03-11 조회 3,429
07-03-11 조회 3,604
07-03-10 조회 5,043