Display Number of Twitter Followers as Text.

arena trick

1. Masuk akaun Blogger.

2. Pilih 'Design'--> 'Add a Gadget'--> 'Html / Javascript'.

3. Copy kod di bawah dan Paste.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$.ajax({
url: 'http://api.twitter.com/1/users/show.json',
data: {screen_name: 'TWITTER-USERNAME'},
dataType: 'jsonp',
success: function(data) {
$('#followers').html(data.followers_count);
}
});
});
</script>


I have <span id="followers">&nbsp;</span> Twitter followers.

Perhatian !!! Gantikan text berwarna merah dengan twitter username anda.Text berwarna biru boleh digantikan mengikut citarasa anda.

No comments:

Post a Comment