Skip to content

Can't seem to make streams work #118

Answered by Eyewais
Eyewais asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry but i figured out that i was not using stream.on() function to get the streams! This should be helpful to anyone who might get confused like me.

const appOnlyClientFromConsumer = await client.appLogin();
console.log(appOnlyClientFromConsumer);
const streamFilter = await client.v1.filterStream({
// See FilterStreamParams interface.
track: 'JavaScript',
follow: [1842984n, '1850485928354'],
});

streamFilter.on(
    // Emitted when a Twitter payload (a tweet or not, given the endpoint).
    ETwitterStreamEvent.Data,
    eventData => console.log('Twitter has sent something:', eventData),
);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alkihis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant