예제 #1
0
        static void Main(string[] args)
        {
            var config = new SentConfig(LogManager.GetCurrentClassLogger());
            var bot    = new TelegramBot();
            var parser = new NewsParser(bot, config);

            while (true)
            {
                try
                {
                    parser.Parse();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
                Thread.Sleep(TimeSpan.FromSeconds(60));
            }
        }
예제 #2
0
        static async Task Main(string[] args)
        {
            var config = new SentConfig(LogManager.GetCurrentClassLogger());
            var bot    = new TelegramBot();
            var parser = new NewsParser(bot, config);

            while (true)
            {
                try
                {
                    await parser.Parse();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
                await Task.Delay(TimeSpan.FromSeconds(60));
            }
        }
예제 #3
0
 public NewsParser(TelegramBot bot, SentConfig config)
 {
     _bot    = bot;
     _config = config;
 }