Open goker-dev opened 11 years ago
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.
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)
})
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:
A Related Question: http://stackoverflow.com/questions/15652361/can-not-use-follow-in-the-streaming-api-in-ntwitter-recieving-unspecified-er