Created
September 25, 2012 03:29
-
-
Save endoze/3779815 to your computer and use it in GitHub Desktop.
Twitter Ajax Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
dataType: 'jsonp', | |
jsonp: 'callback', | |
url: 'http://search.twitter.com/search.json?q=fwgangnamstyle', | |
success: function(obj) { | |
for (var i = 0; i <= obj['results'].length - 1; ++i) { | |
var user = obj['results'][i]['from_user']; | |
var tweet_text = obj['results'][i]['text']; | |
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