Question


var query1 = urlencode($('input[name="searchTerm"]').val()); //user1
$.getJSON('http://twitter.com/friends/ids.json?screen_name='+ query1 +'&jsoncallback=?', 
function(data){
$('content').append(''+data.length+'');
});

This is a simple code that gets the json data from the url

http://twitter.com/friends/ids.json?screen_name=Planemad&jsoncallback=?

(click url to view the json data)

The data looks like this:

[6014732,1717291,14049312,1000591,13,2384071,20,14071015,813286,7517052,14279711,....]

"data.length" should give me the number of users the specified user is following.

However it doesnt seem to work for some reason. Any help would be deeply appreciated.

Thank you.

Was it helpful?

Solution

should the callback not be just callback=?

http://apiwiki.twitter.com/Things-Every-Developer-Should-Know#5Parametershavecertainexpectations

ie http://twitter.com/friends/ids.json?screen_name=Planemad&callback=?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top