Streaming Live Tweets not working.. Need help .. Twit NPM and node js


Hi guys,

I am using TWit NPM module and node js to use live streams… Initially streams are not working… multiple times i refresh my application and send tweets then application receives the tweets. also, sometimes it receives some times not. Below is my code… Any help highly appreciated.

Requirement : User tweets some company account, our application will stream the tweet and it will send the reply as direct messages to the user. Later user will see that messages and reply to the company account via direct messages.
So i constantly have to stream both tweets and direct messages as well. below is my code.

// streaming Normal tweet
var streamnormalTweets =‘statuses/filter’,{track : ‘@pocMantraharsha’});
streamnormalTweets.on(‘tweet’, function (tweet) {

console.log("Received normal tweet");


streamnormalTweets.on(‘error’, function (tweet) {

// streaming direct tweet

var streamDirectTweets =‘user’, { stringify_friend_ids: true });
streamDirectTweets.on(‘direct_message’, function (directMsg) {

console.log(“Received Direct tweet”);


problem : application is not receiving tweets everytime… some time it works sometimes not…