Embed Twitter Status


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <div id="twitter" class="container">
  2. <a href="http://twitter.com/snookca"><img src="/img/twitter.png" alt="Follow me on Twitter"></a>
  3. <p><a id="twitter-post"
  4. href="http://twitter.com/snookca">I say witty things on Twitter.</a></p>
  5. </div>
  6.  
  7. function twitterCallback(o) {
  8. o = o[0]; // o is always an array, so just get the first (and only entry)
  9. var e = document.getElementById('twitter-post');
  10. e.innerHTML = o.text;
  11. e.href = 'http://twitter.com/snookca/status/' + o.id;
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.