Reputation: 6458
Problem : for a given query i try to parse the json from the twitter api results.
Codes at : http://jsfiddle.net/Nstnx/176/
Upvotes: 0
Views: 3058
Reputation: 31033
try this
var url = "http://search.twitter.com/search.json?callback=?&rpp=50&q='ramlila'";
$.getJSON(url, function(data) {
var items = [];
var twitterList = $( "<ul />" );
$.each( data.results, function( index, item ) {
alert(data.results[index].text);
$( "<li />", { "text" : item.from_user} )
.appendTo( twitterList );
});
$( "#output" ).fadeOut( "fast", function(){
$( this ).empty()
.append( twitterList )
.fadeIn( "slow" );
});
});
http://jsfiddle.net/Nstnx/182/
Upvotes: 0
Reputation: 24236
I'm waaaay behind on this, and cwallenpoole should get any credit due for being much quicker , but here's a working demo -
Upvotes: 1
Reputation: 81988
The data parameter has a results
property. You want to iterate over that instead of over the data directly:
This
$.each( data, function( index, item ) {
Should be
$.each( data.results, function( index, item ) {
Upvotes: 5