static void Main(string[] args) { var redditBot = new RedditBot("WikiBot"); redditBot.Authenticate("itggot-vilhelm", "6wm1MJBmHD7J", "56QyJLn_eRVwpA", "cEmNQOeLCfX4J5OawP5DfWGRr54"); Random rand = new Random(); string[] wikis = File.ReadAllLines("C:\\DEV\\RedditBot\\RedditBot\\RedditBot\\wikipedia_subdomains.txt").OrderBy(x => rand.Next()).ToArray(); while (true) { foreach (var wiki in wikis) { Console.BackgroundColor = ConsoleColor.Blue; Console.WriteLine("WIKI: " + wiki); Console.ResetColor(); var links = redditBot.GetWikipediaLinksFromDomainAsync(wiki + ".wikipedia.org").GetAwaiter().GetResult(); foreach (var link in links) { if (redditBot.HasCommentedOnPostAsync(link).GetAwaiter().GetResult() == false) { redditBot.PostCommentWikipediaSummaryAsync(link).GetAwaiter().GetResult(); } } Console.WriteLine("\n"); } } }
static void Main(string[] args) { using (HttpClient client = new HttpClient()) { try { TokenBucket bucket = new TokenBucket(60, 60); RedditBot bot = new RedditBot( ConfigurationManager.AppSettings["clientId"], ConfigurationManager.AppSettings["clientSecret"], ConfigurationManager.AppSettings["RedditUsername"], ConfigurationManager.AppSettings["RedditPassword"], client, bucket, "0.01", "PrettyNiceBot", "sandboxtest/comments", "body"); bot.StartBot(); Console.ReadKey(); } catch (TooLowCapacityException exception) { Console.WriteLine($"Error thrown '{exception.Message}' "); } catch (FaultyLoginException exception) { Console.WriteLine($"Error thrown '{exception.Message}' "); } } }
static void Main(string[] args) { var elegigle = new BotStratergy(); TokenBucket tb = new TokenBucket(30, 60); using (var bot = new RedditBot(tb, elegigle)) { elegigle.Run(bot); Console.ReadKey(); } }
public void Run(RedditBot bot) { bot.LogIn("TheSuperemeBot", "grillkorv123"); var posts = bot.FetchListing("sandboxtest"); foreach (RedditPost post in posts) { if (post.title.Contains("test")) { bot.SaveThreadAsync("tests", post); } } }
static void Main(string[] args) { var clientId = ConfigurationManager.AppSettings["clientId"]; var clientSecret = ConfigurationManager.AppSettings["clientSecret"]; var username = ConfigurationManager.AppSettings["username"]; var password = ConfigurationManager.AppSettings["password"]; RedditBot bot = new RedditBot("UltimateBottyBoi", "1.0"); bot.Authenticate(clientId, clientSecret, username, password); Console.WriteLine($"Is authenticated: {bot.IsAuthenticated()}"); while (true) { bot.RunAndReply(); } //Console.ReadKey(); }