Picture by : www.w3avenue.com
- Masukkan script berikut diantara/didalam kode <head>...</head>. Kalau pusing letakkan saja dibawah/sebelum kode <head>
- Setelah itu masukkan kode HTML berikut ini...
- SAVE dan lihat hasil kreasi sobat ^_^.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
url = "http://NAMA-BLOG-SOBAT"
beforecounter = " [<b>"
aftercounter = "</b>]"
// Get Number of Diggs
$.getJSON('http://services.digg.com/1.0/endpoint?method=story.getAll&link='+url+'&type=javascript&callback=?',
function(data) {
$('#digg').append(beforecounter + data.stories[0].diggs + aftercounter);
});
// Get Number of Delicious Bookmarks
$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url='+url+'&callback=?',
function(data) {
$('#delicious').append(beforecounter + data[0].total_posts + aftercounter);
});
// Get Number of Tweet Count From TweetMeme
$.getJSON('http://api.tweetmeme.com/url_info.jsonc?url='+url+'&callback=?',
function(data) {
$('#twitter').append(beforecounter + data.story.url_count + aftercounter);
});
/*
// Get Number of Tweet Count From Topsy
$.getJSON('http://otter.topsy.com/stats.js?url='+url+'&callback=?',
function(data) {
$('#twitter').append(beforecounter + data.response.all + aftercounter);
});
*/
})
</script>
Hehehe...BeBeN coba pake script bawaan embah google yang http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js ternyata jalan juga. Tapi untuk lebih amannya, pake yang ini saja yah...xixixixi. Tulisan yang berwarna biru pada script diatas ganti dengan URL blog sobat.<script type="text/javascript">
$(document).ready(function() {
url = "http://NAMA-BLOG-SOBAT"
beforecounter = " [<b>"
aftercounter = "</b>]"
// Get Number of Diggs
$.getJSON('http://services.digg.com/1.0/endpoint?method=story.getAll&link='+url+'&type=javascript&callback=?',
function(data) {
$('#digg').append(beforecounter + data.stories[0].diggs + aftercounter);
});
// Get Number of Delicious Bookmarks
$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url='+url+'&callback=?',
function(data) {
$('#delicious').append(beforecounter + data[0].total_posts + aftercounter);
});
// Get Number of Tweet Count From TweetMeme
$.getJSON('http://api.tweetmeme.com/url_info.jsonc?url='+url+'&callback=?',
function(data) {
$('#twitter').append(beforecounter + data.story.url_count + aftercounter);
});
/*
// Get Number of Tweet Count From Topsy
$.getJSON('http://otter.topsy.com/stats.js?url='+url+'&callback=?',
function(data) {
$('#twitter').append(beforecounter + data.response.all + aftercounter);
});
*/
})
</script>
<h2>Share / Bookmark</h2>
<ul>
<li><a href="http://digg.com/submit" id="digg">Digg</a></li>
<li><a href="http://delicious.com/save" id="delicious">Delicious</a></li>
<li><a href="http://twitter.com/" id="twitter">Twitter</a></li>
</ul>
DEMO | DOWNLOAD FILES | ORIGIN POSTED
Source by : www.w3avenue.com
Tidak ada komentar:
Posting Komentar