After a while I refresh the page – It’s OK, I can see the new follower inside the JSON.
I refresh again and now the new follower is GONE (or maybe not, it seems random). It almost looks like it reverted to the previous state before the new follow.
Another refresh and he/she might back (or not).
etc…
After a while it finally stabilizes (at least it seems).
What am I doing wrong? It is annoying because the script is actually sending messages about new followers and unfollowers via IRC to channel’s twitch chat. So it looks like: X followed, X unfollowed, X followed, etc… until it stabilizes.
I thought it’s something like that (if it is). Any way to prevent it? (I suppose I can code in some ‘cooldown time’ for each new (un)follower in which any changes of the follow status will be ignored.) And I’ve got another question: Is there any (API or other) way to track followers list updates? (Apart from catching that from the email notifications.) How does apps like ‘TNotifier’ work?
the one you’ve found seems like the only public endpoint
your idea seems like it would work
another one would be to look at the response headers you’re getting and compare (what you know to be) correct responses to wrong ones. Maybe there’s a date or something else you can use to identify data from an old cache.
I’m seeing the exact same behavior and I think Hephaestus is correct as well. At least that was my guess too.
What I’m doing to handle this is creating a local cache with an age. Removals are only removed after five minutes. This keeps oscillations from making my bot go crazy.