Skip to content

Instantly share code, notes, and snippets.

@gregbell
Created March 30, 2010 20:28
Show Gist options
  • Save gregbell/349556 to your computer and use it in GitHub Desktop.
Save gregbell/349556 to your computer and use it in GitHub Desktop.
// Assuming jQuery is on the page, this will append the search tweets
// to an element with the id of 'twitter'
$.getJSON("http://search.twitter.com/search.json?q=adobe+sucks&callback=?", function(data){
$.each(data.results, function(i, tweet){
var tweetContent = '<div class="tweet">';
tweetContent += '<p class="tweet-body">' + tweet.text + '</p>';
tweetContent += '<p class="tweet-meta"><a href="http://twitter.com/' + tweet.from_user + '">' + tweet.from_user + '</a> at ' + tweet.created_at + '</p></div>';
$('#twitter').append(tweetContent);
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment