Get your latest Tweet using the JSON timeline

There are a few ways in which I have seen to get the latets Tweet from Twitter to display on a site. The easiest solution I have found uses the JSON timeline of Tweets.

In the example below, I have used this method and formatted the tweets into a list. It can then be styled how you like from there.

The Javascript

The twitterCallback2() function formats the Tweets nicely for you and uses the relative_time() function to get the time it was created and display that.


Below is the HTML you should use to display the Tweets. If you want more than 1, simply change the value of ‘count’ so it is greater.