function loadUserTweets() { clearTweets(); //var url = "http://twitter.com/status/user_timeline/djuth.json?count=10&callback=?"; var url = "http://twitter.com/status/user_timeline/" + $("#userName").val() + ".json?count=" + $("#numTweets").val() + "&callback=?"; $.getJSON(url, function(data){ $.each(data, function(i, item) { if (i == 0) { $("img#profile").attr("src", item.user["profile_image_url"]); $("a#url").attr("href", item.user["url"]).attr("target", "_blank").append(item.user["url"]); $("#user").append("Name: " + item.user["name"]); $("#screenName").append("User name: " + item.user["screen_name"]); $("#location").append("Location: " + item.user["location"]); $("#description").append("Description: " + item.user["description"]); $("#followers").append("Followers: " + item.user["followers_count"]); } var htmlTag = "<div style=\"border:solid 1px #FFF;min-height:20px;"; if (i % 2) { htmlTag += "background-color:#EEE;"; htmlTag += "\" onmouseover=\"javascript:this.style.border='solid 1px #000';\" onmouseout=\"javascript:this.style.border='solid 1px #FFF';\""; } else { htmlTag += "\" onmouseover=\"javascript:this.style.border='solid 1px #000';\" onmouseout=\"javascript:this.style.border='solid 1px #FFF';\""; } $("#resultsTweets").append(htmlTag + "<span style=\"color:#999;\">" + relative_time(item.created_at) + "</span> " + item.text.linkify() + " via " + item.source + "</div>"); i++; }); }); $("#btnFollow").show(); }