Exemple #1
0
        private void CheckTwitterFollows()
        {
            if (_twitterStream == null)
            {
                return;
            }

            foreach (var user in _config.TwitterUpdates.TwitterUsers)
            {
                var userId = Convert.ToInt64(user);
                if (_twitterStream.ContainsFollow(userId))
                {
                    continue;
                }

#pragma warning disable RECS0165
                _twitterStream.AddFollow(userId, async x =>
#pragma warning restore RECS0165
                {
                    if (userId != x.CreatedBy.Id)
                    {
                        return;
                    }
                    //if (x.IsRetweet) return;

                    await SendTwitterNotification(x.CreatedBy.Id, x.Url);
                });
            }
        }