I’m using the following code to call the latest tweet on to my site:
<script type="text/javascript">
$('document').ready(function() {
$.getJSON('http://twitter.com/statuses/user_timeline/username.json?callback=?', function(data) {
$('#tweet').html(data[0].text);
});
});
</script>
In to the DIV:
<div id="tweet"></div>
I’m just wondering what I need to add to display the date of the last tweet and display it in a “Posted X day(s) ago” format.
The timeago plugin is the often go-to for this, with that you just need to use the
created_atproperty of the tweet, for example:You can give it a try here.