eaceaser / bubu-followers

NodeCG Followers Tracker
MIT License
6 stars 4 forks source link

Adds concept of New Followers where they are NOT in the past known #3

Open coolacid opened 8 years ago

coolacid commented 8 years ago

There are times where a spammer will attempt to unfollow, and refollow to get their name mentioned multiple times.

This PR stores stores the last followers in a replicant array and checks to see if the follower is NOT in that array. If it is not, triggers a new message "newFollower".

I'm concerned that if the array gets too big it will slow down drastically, but this is a good start.

coolacid commented 8 years ago

FTR: I was finally able to get to test this. I unfollowed a channel, waited for my name to drop from the follower list, then refollowed. I got the "follower" message, but not the "newFollower" message.

Also, I'm toying with the idea of capping the array to say 1,000. Something like:

if (array.length > 1000) array.length = 1000

Much like: http://jsfiddle.net/orolo/wJDXL/

coolacid commented 8 years ago

ping :)