Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“follow” options does not work in streaming. twitter returns 406 Not Acceptable #107

Open
goker-dev opened this issue May 30, 2013 · 2 comments

Comments

@goker-dev
Copy link

I try to use follow options in stream function but twitter retuns 406 Not Acceptable
Returned by the Search API when an invalid format is specified in the request.

MY USAGE:

twit.stream('statuses/filter', { 'follow':'gokercebeci' }, 
function(stream) {
    stream.on('data',function(data){
      console.log(data);
    });
});

__ A Related Question: __
http://stackoverflow.com/questions/15652361/can-not-use-follow-in-the-streaming-api-in-ntwitter-recieving-unspecified-er

@joedyndale
Copy link

I'm using 'follow' and it works just fine for me. You have to use the userId (the number) of the user, and not the username when specifying who to follow. This can be retrieved with a different API call, or from a site like http://mytwitterid.com/ if you just need a few predefined users.

UPDATE: OK, I see an answer stating the same thing has been posted on that StackOverflow qurestion - but might as well keep this here as well.

@siwalikm
Copy link

You have to use the userID not the userName. I was doing the same mistake for quite sometime but not it works perfectly.
code =>

var   Twit = require('twit');
 
var T = new Twit({
  consumer_key:         config.key.consumer_key,
  consumer_secret:      config.key.consumer_secret,
  access_token:         config.key.access_token,
  access_token_secret:  config.key.access_token_secret
});

var stream = T.stream('statuses/filter', { follow: 4708084272 })
stream.on('tweet', function (tweet) {
  console.log(tweet)
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants