Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: How to get long followers list

$
0
0
I am using this code:

do
                        {
                            var results = TwitterAccessor.ExecuteCursorGETCursorQueryResult<IIdsCursorQueryResultDTO>(followerQuery, int.MaxValue, cursor);
                            if (results != null)
                            {
                                var resultsArray = results.ToArray();
                                for (var resultIndex = arrayCursor; resultIndex < resultsArray.Length; resultIndex++)
                                {
                                    var resAPI = false;
                                    resAPI = this.setFollowers(resultsArray[resultIndex], scrapId);
                                    if (!resAPI)
                                    {

                                        lists.resumeScrap(DateTime.Now, resultIndex, cursor, scrapId);
                                        lists.setListStatus("pause", scrapId);
                                        return;
                                    }
                                    else {
                                        lists.updateCursor((resultIndex + 1), scrapId);
                                    }
                                }
                                cursor = results.Last().NextCursor;
                            }
                        } while (cursor != 0);
It works the first time, I get 15 arrays with 5000 Ids but it´s and account of 300.000
How to store in db de correct cursor for resuming and continue the scrap in the same position??

Thanks!!

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>