client.stream("statuses/filter", { track: "twitter" }, function (stream) { stream.on("data", function (tweet) { console.log(tweet.text); }); stream.on("error", function (error) { console.log(error); }); });
The error is:
Error: Status Code: 403 at Request.<anonymous> (D:\WebCode\TestAPI\node_modules\twitter\lib\twitter.js:277:28) at Request.emit (node:events:513:28) at Request.onRequestResponse (D:\WebCode\TestAPI\node_modules\request\request.js:1059:10) at ClientRequest.emit (node:events:513:28) at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:701:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) at TLSSocket.socketOnData (node:_http_client:542:22) at TLSSocket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9)
I write the code, but get an error
client.stream("statuses/filter", { track: "twitter" }, function (stream) { stream.on("data", function (tweet) { console.log(tweet.text); }); stream.on("error", function (error) { console.log(error); }); });
The error is:
Error: Status Code: 403 at Request.<anonymous> (D:\WebCode\TestAPI\node_modules\twitter\lib\twitter.js:277:28) at Request.emit (node:events:513:28) at Request.onRequestResponse (D:\WebCode\TestAPI\node_modules\request\request.js:1059:10) at ClientRequest.emit (node:events:513:28) at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:701:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) at TLSSocket.socketOnData (node:_http_client:542:22) at TLSSocket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9)