Skip to content

Instantly share code, notes, and snippets.

@pinktrink
Created September 25, 2012 04:27
Show Gist options
  • Save pinktrink/3779981 to your computer and use it in GitHub Desktop.
Save pinktrink/3779981 to your computer and use it in GitHub Desktop.
$.ajax({
dataType: 'jsonp',
jsonp: 'callback',
url: 'http://search.twitter.com/search.json?q=%23fwgangnamstyle',
success: function(obj) {
for (var i = 0, j = obj.results.length; i < j; ++i) {
var user = obj.results[i].from_user;
var tweet_text = obj.results[i].text.replace(/#[\w\d]+/g, "<a href=\"https://twitter.com/$&\" target=\"_blank\">");
var html = "<li><a href=https://twitter.com/" + user + ">@" + user + "</a> said " + tweet_text + "</li>";
console.log(obj.results[i]);
$("#tweet-feed ul").append(html);
};
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment