Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple jQuery getJSON Call to Twitter

I have read many Twitter & jQuery questions on here but none seem to answer my question. I am simply trying to grab 5 "tweets" from a public user. I am not doing anything with the data at this step, 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

Thank you for your help

like image 984
AdamDev Avatar asked Dec 09 '25 20:12

AdamDev


1 Answers

That isn't going to work because Twitter has now required that you authenticate in order to fetch tweets for a given user.

Reference: https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline Look at 'Authentication' info.

You'll want to use a library to help get an oauth signature and make the request.

like image 127
Nirvana Tikku Avatar answered Dec 12 '25 10:12

Nirvana Tikku