freeCodeCamp / 100DaysOfCode-twitter-bot

Twitter bot for #100DaysOfCode
https://twitter.com/_100DaysOfCode
BSD 3-Clause "New" or "Revised" License
285 stars 110 forks source link

Thoughts on using .stream #86

Closed spences10 closed 7 years ago

spences10 commented 7 years ago

Thoughts on using bot.stream('statuses/filter' in place of search?

So, in place of having:

setInterval(retweet, retweetFrequency) 

Then the search function in the retweet module and the parameter passed in with the search terms. Why not have all the search terms in a search parameter?

const trackStream = bot.stream('statuses/filter', {
  track: trackWords
})
trackStream.on('tweet', retweet)

There would possibly need to be some form of filter so as not to RT absolutely everything that is tweeted, but with this method, we can track more than just 100DaysOfCode tag

amandeepmittal commented 7 years ago

Let's use this in the branch?

spences10 commented 7 years ago

this branch?

amandeepmittal commented 7 years ago

Yes.

spences10 commented 7 years ago

@amandeepmittal it's been a while since I have looked at this I have done a bit of work on it but I think I'm getting caught up on the sentiment

Are you able to take a look at the branch and let me know your thoughts?

https://github.com/spences10/100DaysOfCode-twitter-bot/tree/use-graphcool

Thanks

spences10 commented 7 years ago

Ok, so with the work I have done with this:

https://github.com/spences10/delay-tweet

We can use part of it for the .on('tweet) method so it tweets from the stream

I need to build in limits so that they're not blown consistently, and then Ideally make it into an npm package but I'm going to say that this can be added for this enhancement

Thoughts @amandeepmittal ?