if (typeof(topcmm_twitter_account) == 'undefined' || topcmm_twitter_account.length == 0) { var topcmm_twitter_account = "123flashchat"; } function sendTwitterRequest() { $.ajax({ url: 'http://api.twitter.com/1.1/followers/ids.json', data: {screen_name: topcmm_twitter_account}, dataType: 'jsonp', success: function(data) { var ids = data.ids; var idList = ''; for (var i=0;i<48;i++) { if (ids[i]) { idList += ids[i]+','; } } $.ajax({ url: 'http://api.twitter.com/1.1/users/lookup.json', data: {user_id: idList}, dataType: 'jsonp', success: function(data) { followers = ''; for (follower in data) { if(typeof(data[follower]['profile_image_url']) != 'undefined') { followers += "\"""; } } $("#twitter_follow").html(followers); } }); } }); $.ajax({ url: 'http://api.twitter.com/1.1/statuses/user_timeline.json', data: {screen_name: topcmm_twitter_account, exclude_replies: 'true', trim_user: 'true'}, dataType: 'jsonp', success: function(data) { var tweets = ''; for(var i=0;i

" + data[i].text.replace(/http:\/\/t.co\/(\S+)/g, "http://t.co/$1") + "

" + data[i].created_at.replace(/(\S+) (\S+) (\S+)(.*)/g, "$1 $2 $3") + ""; } $("#tweets").html(tweets); } }); } topcmm.extensions.twitter = { tip: "Twitter", position: "top", width: "500", height: "350", display: { type: "html", value: "
" + "Stream
" }, content: "
", action: "sendTwitterRequest()" }