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

Streams do not work #586

Open
Fima2003 opened this issue Sep 12, 2023 · 2 comments
Open

Streams do not work #586

Fima2003 opened this issue Sep 12, 2023 · 2 comments

Comments

@Fima2003
Copy link

I have this code, that is supposed to stream whatever Elon Musk is posting:

const twitter = new Twit({`consumer and access tokens provided`});

var stream = twitter.stream('statuses/filter', { track: '@elonmusk' });

stream.on('tweet', (tweet) => {
  console.log(tweet);
});

stream.on('error', (error) => {
  console.error(error);
});

But, whenever I run it, I get

Error: Bad Twitter streaming request: 404
    at exports.makeTwitError (Documents/nCommBot/nCommentTwitter/node_modules/twit/lib/helpers.js:74:13)
    at Request.<anonymous> (Documents/nCommBot/nCommentTwitter/node_modules/twit/lib/streaming-api-connection.js:96:29)
    at Request.emit (node:events:525:35)
    at IncomingMessage.<anonymous> (/Documents/nCommBot/nCommentTwitter/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (node:events:627:28)
    at IncomingMessage.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: null,
  allErrors: [],
  twitterReply: '',
  statusCode: 404
}

Honestly, I have no idea what is wrong with this noe....

@MaragiDev
Copy link

March 14, 2023
Twitter API v1.1

Today, we are deprecating the statuses/filter endpoint in the Twitter API v1.1 Developers can use the filtered stream endpoint in the Twitter API v2.

@MaragiDev
Copy link

last commit was 2018, this hasnt been updated since 2018

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

2 participants