Example #1
0
        /// <summary>
        /// Retrieves the latest / top 'n' tweets from the authenticated user's timeline.
        /// </summary>
        /// <param name="maximumNumberOfTweets">The number of tweets to retrieve</param>
        /// <returns></returns>
        public IList <ITweet> GetLastestNTweetsFromTimeLine(int maximumNumberOfTweets)
        {
            System.Console.WriteLine($"[GetLastestNTweetsFromTimeLine]: Attempting retrieval of '{maximumNumberOfTweets}' tweets from the timeline.");

            IAuthenticatedUser user           = User.GetAuthenticatedUser();
            List <ITweet>      timelineTweets = new List <ITweet>(user.GetUserTimeline(maximumNumberOfTweets: maximumNumberOfTweets));

            System.Console.WriteLine($"[GetLastestNTweetsFromTimeLine]: Retrieved '{timelineTweets.Count}' tweets from the timeline.");
            return(timelineTweets);
        }
Example #2
0
        private static void CalculateMetrics()
        {
            IEnumerable <ITweet> timeline = authenticatedUser.GetUserTimeline(int.MaxValue);

            foreach (ITweet tweet in timeline)
            {
                likes    = likes + tweet.FavoriteCount;
                retweets = retweets + tweet.RetweetCount;
            }
            followers  = authenticatedUser.GetFollowers(int.MaxValue).Count();
            following  = authenticatedUser.GetFriends(int.MaxValue).Count();
            tweetCount = timeline.Count();
            imageCount = Directory.GetFiles("./hentai", "", SearchOption.AllDirectories).Length;
        }
Example #3
0
 public IEnumerable <ITweet> GetTimeline(int numberOfTweets, IAuthenticatedUser _user)
 {
     //return Timeline.GetUserTimeline(_user, numberOfTweets);
     return(_user.GetUserTimeline(numberOfTweets));
 }