title: Twitter and jQuery , render tweeted links
body: <p>I am using jquery ajax to pull from the twitter api, i'm sure there's a easy way, but I can't find it on how to get the "tweet" to render any links that were tweeted to appear as a link. Right now it's only text.</p>
  
  <pre><code>$.ajax({  
              type : 'GET',  
              dataType : 'jsonp',  
              url : 'http://search.twitter.com/search.json?q=nettuts&amp;rpp=2',  
  
              success : function(tweets) {  
                 var twitter = $.map(tweets.results, function(obj, index) {  
                    return {  
                       username : obj.from_user,  
                       tweet : obj.text,  
                       imgSource : obj.profile_image_url,  
                       geo : obj.geo  
                    };  
                 });  
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  The following function (plugin) works perfectly.</p>
  
  <pre><code>(function($) {
  
      $.socialFader = function(options) {
  
          var settings = {
              tweetHolder : null,
              tweetCount  : 100,
              fadeSpeed   : 500,
              tweetName: 'jquery'
          };  
  
          if (options) {
              $.extend(settings, options);
          };
  
          var URL = "http://search.twitter.com/search.json?q="+settings.tweetName+"&amp;rpp=" + settings.tweetCount + "&amp;callback=?";
  
          function relative_time(time_value) {
  
              var values = time_value.split(" ");
              time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3];
              var parsed_date = Date.parse(time_value);
              var relative_to = (arguments.length &gt; 1) ? arguments[1] : new Date();
              var delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
              delta = delta + (relative_to.getTimezoneOffset() * 60);
              var r = '';
              if (delta &lt; 60) {
                  r = 'a minute ago';
              } else if(delta &lt; 120) {
                  r = 'couple of minutes ago';
              } else if(delta &lt; (45*60)) {
                  r = (parseInt(delta / 60)).toString() + ' minutes ago';
              } else if(delta &lt; (90*60)) {
                  r = 'an hour ago';
              } else if(delta &lt; (24*60*60)) {
                  r = '' + (parseInt(delta / 3600)).toString() + ' hours ago';
              } else if(delta &lt; (48*60*60)) {
                  r = '1 day ago';
              } else {
                  r = (parseInt(delta / 86400)).toString() + ' days ago';
              }
  
           return r;
  
          };
  
          String.prototype.hashify = function() {
              return this.replace(/#([A-Za-z0-9\/\.]*)/g, function(m) {
                  return '&lt;a target="_new" href="http://twitter.com/search?q=' + m.replace('#','') + '"&gt;' + m + "&lt;/a&gt;";
              });
          };
  
          String.prototype.linkify = function(){
              return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&amp;\?\/.=]+/, function(m) {
                  return m.link(m);
              });
          };
  
          String.prototype.atify = function() {
              return this.replace(/@[\w]+/g, function(m) {
                  return '&lt;a href="http://www.twitter.com/' + m.replace('@','') + '"&gt;' + m + "&lt;/a&gt;";
              });
          }; 
  
          $.getJSON(URL, function(JSON) {
  
              $.each(JSON.results, function(i, tweet) {
  
                  var profilePicture = tweet.profile_image_url;
                  var userLink = tweet.from_user;
                  var text = tweet.text;
                  text = text.linkify().atify().hashify();
                  var createdAt = new Date(tweet.created_at);
                  var myTweet = '&lt;a href="http://www.twitter.com/' + userLink + '" title="' + userLink + '"&gt;' + userLink + '&lt;/a&gt; ';
                  myTweet += text;
                  $(settings.tweetHolder).append('&lt;li class="cycles"&gt;' + myTweet + '&lt;/li&gt;');
  
              });
  
              var elements = $(settings.tweetHolder).children();
              var timeOutStart = 5000;
  
              function fader(elementId) {
                  setTimeout(function() {
                      $(elements[elementId]).fadeOut(settings.fadeSpeed, function() {
                          $(elements[elementId + 1]).fadeIn(settings.fadeSpeed);
                      });
                  }, timeOutStart * (elementId));
              };
  
              for (var j = 0; j &lt; elements.length; j++) {
                             fader(j);
                         };
  
          });
  
      };
  
  })(jQuery);
  </code></pre>
  
  <p><strong>Within my Ready Statement :</strong></p>
  
  <pre><code>$.socialFader({ tweetHolder:"#twitter", tweetName:"nettuts", tweetCount:2 });
  </code></pre>