Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahemoff/803526 to your computer and use it in GitHub Desktop.
Save mahemoff/803526 to your computer and use it in GitHub Desktop.
*** JS ***
var $twitbox = $("<div class='twitbox'/>")
.html("<div>Loading</div>")
.appendTo("#main-table .nav");
var url = "http://twitter.com/status/user_timeline/techmeme.json?count=10&callback=?";
$.getJSON(url, function(tweets) {
$twitbox.empty();
$("<h3/>").html("@techmeme says").appendTo($twitbox);
$.each(tweets, function(i, tweet) {
$("<div/>")
.appendTo($twitbox)
.html(linkify(tweet.text))
});
});
*** CSS ***
.twitbox { margin: 1em 0; font-size: 0.8em;
border: 1px solid black; }
.twitbox > * { padding: 5px; }
.twitbox h3 { margin-bottom: 0.5em; }
.twitbox div { border-top: 1px solid #ddd; }
*** LIBS ***
https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js
http://benalman.com/code/javascript/ba-linkify.min.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment