You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I would like to know if it is possible to make a rule and use it in only one get stream, much like it was in v1
In my attempt to use v1 filtered streaming, I am receiving only a 403 response. Could you please advise me?
here is the error:
Uncaught ApiResponseError Error: Request failed with code 403
at ApiResponseError (c:\Upwork\pengu-react\server\node_modules\twitter-api-v2\dist\types\errors.types.js:71:15)
at createResponseError (c:\Upwork\pengu-react\server\node_modules\twitter-api-v2\dist\client-mixins\request-handler.helper.js:103:16)
at onResponseEndHandler (c:\Upwork\pengu-react\server\node_modules\twitter-api-v2\dist\client-mixins\request-handler.helper.js:252:25)
at emit (events:513:28)
at endReadableNT (internal/streams/readable:1358:12)
at processTicksAndRejections (internal/process/task_queues:83:21)
here is my code:
var streamFilter = await userClient.v1.filterStream({
// See FilterStreamParams interface.
track: `from:${handle}`,
});
streamFilter.on(ETwitterStreamEvent.Data, function (tweet) {
console.log(tweet);
io.to(`twitter_${handle}`).emit("data-monitored", { type: "twitter", handle, reason: "TweetCreate" })
})
streamFilter.on(
// Emitted when Node.js {response} emits a 'error' event (contains its payload).
ETwitterStreamEvent.ConnectionError,
err => console.log('Connection error!', err),
);
streamFilter.on(
// Emitted when Node.js {response} is closed by remote or using .close().
ETwitterStreamEvent.ConnectionClosed,
() => console.log('Connection has been closed.'),
);
streamFilter.on(
// Emitted when a Twitter sent a signal to maintain connection active
ETwitterStreamEvent.DataKeepAlive,
() => console.log('Twitter has a keep-alive packet.'),
);
// Enable reconnect feature
streamFilter.autoReconnect = true;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey, I would like to know if it is possible to make a rule and use it in only one get stream, much like it was in v1
In my attempt to use v1 filtered streaming, I am receiving only a 403 response. Could you please advise me?
here is the error:
here is my code:
Beta Was this translation helpful? Give feedback.
All reactions