1

I am trying to get the last 3 tweets from my twitter account. I am running express.js with node.js and have installed ntwitter. The app has been authenticated and I entered in the correct security tokens. When I test to see if the app authenticated I get a success response but then when I send a request for the tweets I get a null response. Perhaps ntwitter is installed in the wrong directory or I could be issuing the request wrong.

Code:

twit
   .verifyCredentials(function (err, data) {
    console.log("Verifying Credentials...");
    if(err)
      console.log("Verification failed : " + err);
    else
      console.log("Verification succeeded");    
  });

twit.get('/statuses/user_timeline.json', { count: 1 }, function(data) {
    console.log(util.inspect(data));
});

Console:

Express server listening on port ...:
Verifying Credentials...
Verification succeeded
null

Any and all help would be appreciated. Thank you.

SCADA
  • 11
  • 1

1 Answers1

0

Can you try this.This worked in my case

<script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script>

<script type="text/javascript"> 

(function() {

   var e = document.createElement('script'); 

   e.type = 'text/javascript';

  e.async = true;

    e.src = 'http://twitter.com/statuses/user_timeline/YOUR_USERNAME_HERE.json?callback=twitterCallback2&count=3';

   document.getElementById('twitter_update_list').appendChild(e);

}());

</script> 
BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
SemperFi
  • 2,358
  • 6
  • 31
  • 51
  • This no longer works with twitter API v1.1. Twitter now requires OAuth, so you can no longer retrieve tweets using only client-side code. See http://stackoverflow.com/questions/12390398/getting-latest-tweets-with-api-1-1 – stephen.hanson Jul 11 '14 at 16:52