Cara Membuat RSS Feed Displayer
Wednesday, April 20, 2011
0
comments
Adsense Content. recommended 336 X 300
20 April
Sekarang saya akan menerangkan Cara Membuat RSS Feed Displayer. RSS Feed Displayer ini berbentuk widget sederhana, namun anda dapat memasukkan beberapa konten berita dari DIGG dan MSN. Ok langsung kita bongkar cara pembuatannya. Silahkan ikuti langkah berikut.Pertama-tama anda harus mendaftar blog anda di google-api untuk mendapatkan kode api key anda. Silahkan daftar di sini
Log in ke blog anda
Klik Rancangan
Klik Edit HTML
Masukkan kode berikut di atas kode </head>
<script src='http://www.google.com/jsapi?key=masukkan kode google api anda disini'type='text/javascript'></script>
<script src='http://bloekoetoek-blogonol.googlecode.com/files/gfeedfetcher.js'
type='text/javascript'>
</script>
<style type='text/css'>
.labelfield{
color:brown;
font-size: 90%;
}
.datefield{
color:gray;
font-size: 90%;
}
#example1 li{
margin-bottom: 4px;
}
#example2 div{
margin-bottom: 5px;
}
#example2 div a{
text-decoration: none;
}
#example3 a{
color: #D80101;
text-decoration: none;
font-weight: bold;
}
#example3 p{
margin-bottom: 2px;
}
code{
color: red;
}
</style>
Simpan Template
Klik Lagi Rancangan
Klik Tambah Gadget
Pilih HTML/JavaScript
Masukkan kode berikut ke dalamnya
<div style="width: 100%; height: 300px; overflow: auto;">
<h3>blogonol</h3>
<script type="text/javascript">
var cssfeed=new gfeedfetcher("example1", "example1class", "")
cssfeed.addFeed("blogonol", "http://blogonol.blogspot.com/atom.xml") //Specify "label" plus URL to RSS feed /* ganti tulisan merah dengan alamat blog anda */
cssfeed.displayoptions("date") //show the specified additional fields
cssfeed.setentrycontainer("li") //Display each entry as a list (li element)
cssfeed.filterfeed(10, "title") //Show 10 entries, sort by date
cssfeed.init() //Always call this last
</script>
<br /><br />
<h3>DIGG</h3>
<script type="text/javascript">
var socialfeed=new gfeedfetcher("example2", "example2class", "_new")
socialfeed.addFeed("Slashdot", "http://rss.slashdot.org/Slashdot/slashdot") //Specify "label" plus URL to RSS feed
socialfeed.addFeed("Digg", "http://digg.com/rss/index.xml") //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 />
<h3>BBC News and MSN</h3>
<script type="text/javascript">
var newsfeed=new gfeedfetcher("example3", "example3class", "_new")
newsfeed.addFeed("BBC", "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml") //Specify "label" plus URL to RSS feed
newsfeed.addFeed("MSNBC", "http://www.msnbc.msn.com/id/3032091/device/rss/rss.xml") //Specify "label" plus URL to RSS feed
newsfeed.addFeed("Yahoo News", "http://rss.news.yahoo.com/rss/topstories") //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></div>
Simpan Template dan lihat hasilnya
Selamat mencoba dan sukses selalu
"keep spirits and do the best"
0 comments:
Post a Comment