Last Tweet HTML
Thursday, March 14th, 2013I thought I’d share a useful tip on how to place your latest tweet or tweets into an HTML page. For example, see the footer bottom right of this iPhone app website template. It’s very simple. First you’ll need to reference some javascript:
<script type="text/javascript" mce_src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" mce_src="http://api.twitter.com/1/statuses/user_timeline/templatis.json?callback=twitterCallback2&count=1"></script>
Paste these two lines anywhere within your HTML. Before the closing </body> for example.
Place your chosen twitter username in place of “templatis” (before .json), in the second URL. The other thing you might want to change is the number after “count”. This changes the number of tweets displayed. For the last two tweets, instead of just the last one, change to “count=2″.
Next you’ll need to place the following code, wherever you want your last tweet or tweets to appear:
<div id="twitter_div"> <ul id="twitter_update_list"> <li> </li> </ul> </div> You can now style your HTML using your CSS style sheet.
That’s it! If you use this tip, please tweet, like or otherwise share it. Give us credit!
Good luck!