Creating a custom Twitter feed: How to remove the time stamp from tweets

Here is the easiest way that I have found to remove time stamps from your custom Twitter feed.

Note: You can find detailed instructions on how to create a custom Twitter feed quickly and easy as well as several examples of pre-styled custom Twitter feeds for you to use and customize for your own site at blog.thelibzter.com, and instructions on how to create a custom Twitter feed of the search results for a specific term right here on Icode4you.net.

Open the html page where you have your Twitter feed, scroll down to the bottom of the page, and erase this line:

<script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script>

In its place, copy and paste this code:

<script type="text/javascript">
function twitterCallback2(twitters) {
  var statusHTML = [];
  for (var i=0; i<twitters.length; i++){
    var username = twitters&#91;i&#93;.user.screen_name;
    var status = twitters&#91;i&#93;.text.replace(/((https?|s?ftp|ssh)\:\/\/&#91;^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
      return '<a href="'+url+'">'+url+'</a>';
    }).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
      return  reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>';
    });
    statusHTML.push('<li><span>'+status+'</span> <a style="font-size:85%" href="http://twitter.com/'+username+'/statuses/'+twitters&#91;i&#93;.id_str+'">'+relative_time(twitters[i].created_at)+'</a></li>');
  }
  document.getElementById('twitter_update_list').innerHTML = statusHTML.join('');
}

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 > 1) ? arguments[1] : new Date();
  var delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
  delta = delta + (relative_to.getTimezoneOffset() * 60);

  if (delta < 60) {
    return '';
  } else if(delta < 120) {
    return '';
  } else if(delta < (60*60)) {
    return '';
  } else if(delta < (120*60)) {
    return '';
  } else if(delta < (24*60*60)) {
    return '';
  } else if(delta < (48*60*60)) {
    return '';
  } else {
    return '';
  }
}
</script>

This code tells our Twitter feed to return empty values instead of the time stamp.

Save the file and re-upload it to your site. Your Twitter feed should be working exactly as it was before with the exception that there are no time stamps on your tweets.

You can see a working example of a custom Twitter feed with no time stamp here.

Further reading: You can find detailed instructions on how to create a custom Twitter feed  and several examples of pre-styled custom Twitter feeds at blog.thelibzter.com, and instructions on how to create a custom Twitter feed of the search results for a specific term right here on Icode4you.net.

As always, just let me know if you have any questions or problems.