Best way to check for new follower?

Sep 2, 2015 at 9:21 AM
Hi,

is the best and right to to check for NEW followers really to get all followers each time and compare them with e.g. stored in a database follower entries?

Or is there something like "get new followers after date xy"?

Kay
Coordinator
Sep 2, 2015 at 9:31 AM
Edited Sep 2, 2015 at 9:39 AM
Twitter and myself would tell you to use UserStream and store the information in the database.
var us = Stream.CreateUserStream();
us.FollowedByUser += (sender, args) =>
{
    Console.WriteLine(args.User + " is now following you.");
};
us.StartStream();
The issue with UserStream is that you need the credentials of the user you want to follow.

If you don't have the user credentials, you will have to do a GetFollowers. GetFollowers will return the new follower first if I remember correctly (needs to be verified).

Then just AddOrUpdate in your database the user retrieved from the GetFollowers and call the query as many times as you need to refresh your database.

Linvi
Sep 2, 2015 at 9:56 AM
Thanks, I will try.

Use case: For an account where I have the credentials I like to call a "checkForNewFollower" function periodically (e.g. every hour) to get only NEW followers to send them a welcome message.

And btw: Thanks a lot for your library!!!