title: How to generate the markup of an tweet?
body: <p>I was wondering how I can set plain text and links inside a span or whatever.
  Below my working code:</p>
  
  <pre><code>$(document).ready(function() {
  
  // Get latest tweet
  // twitter id
  var user = 'USERNAME';
  
  // count
  $.getJSON('http://api.twitter.com/1/statuses/user_timeline.json?screen_name=' + user + '&amp;count=1&amp;include_rts=1&amp;callback=?', function(data)      {
  
      // result
      var tweet = "";
          for (i = 0; i &lt; data.length; i++) {
              tweet += data[i].text + "&lt;/br&gt;&lt;/br&gt;";
          }
  
      // links
      tweet = tweet.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\/%=~_|])/ig, function(url) {
          return '&lt;a target="_blank" href="'+url+'"&gt;'+url+'&lt;/a&gt;';
      }).replace(/B@([_a-z0-9]+)/ig, function(reply) {
          return  reply.charAt(0)+'&lt;a href="http://twitter.com/'+reply.substring(1)+'"&gt;'+reply.substring(1)+'&lt;/a&gt;';
      });
  
      // output
      $("#tweet").html(tweet);
  });
  
  });
  </code></pre>
  
  <p>Thanks in advance.</p>