Simple jQuery getJSON Call to Twitter
I've read a lot of questions about Twitter and jQuery, but no one seems to have answered my question. I'm just trying to grab 5 "tweets" from a public user. I am not doing anything with the data at this point, but my callback function never fires.
$.getJSON("https://api.twitter.com/1.1/statuses/user_timeline.json?callback=?",
{
screen_name: 'dojo',
count: '5'
},
function (data) {
alert("IT WORKED!");
});
Here is the same code on jsFiddle
thanks for the help
+3
source to share
1 answer
This won't work because Twitter now requires you to be authenticated to receive tweets for a given user.
Link: https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline Look at the "Authentication" information.
You will want to use a library to help get the oauth signature and make the request.
+5
source to share