public void followUser() { List <string> users = tweetPublisher.searchForTweets(); var currentUser = User.GetLoggedUser(); try { currentUser.FollowUser(users[rand.Next(0, users.Count)]); } catch (Exception e) { Console.WriteLine(e); } }
public void runBot() { tweetPublish publishTweet = new tweetPublish(); FollowerManager followerManager = new FollowerManager(); Random rand = new Random(); int roll = 5;//rand.Next(0,5); #region ifStatement //if (roll == 1) //{ // publishTweet.searchForTweets(); // //timer // runBot(); //} //else if (roll == 2) //{ // publishTweet.replyToUser(); // //timer // runBot(); //} //else if (roll == 3) //{ // publishTweet.tweetWithMedia(); // //timer // runBot(); //} //else if(roll == 4) //{ // publishTweet.tweetTrending(); // runBot(); //} #endregion switch (roll) { case 1: publishTweet.searchForTweets(); Console.WriteLine("sleeping two minutes"); Thread.Sleep(120000); // 2 minues runBot(); break; case 2: publishTweet.replyToUser(); Console.WriteLine("sleeping two minutes"); Thread.Sleep(120000); // 2 minues runBot(); break; case 3: publishTweet.tweetWithMedia(); Console.WriteLine("sleeping two minutes"); Thread.Sleep(120000); // 2 minues runBot(); break; case 4: publishTweet.tweetTrending(); Console.WriteLine("sleeping two minutes"); Thread.Sleep(120000); // 2 minues runBot(); break; case 5: followerManager.followUser(); Console.WriteLine("sleeping two minutes"); Thread.Sleep(120000); // 2 minues break; } }