Exemplo n.º 1
0
 public static RedditWatcher GetInstance()
 {
     if (_instance == null)
     {
         lock (_instanceLock)
             if (_instance == null)
             {
                 _instance = new RedditWatcher();
             }
     }
     return(_instance);
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            // Load settings
            SettingsController.GetInstance();

            // Start Telegram client
            var telegramClient = new TelegramClient();

            // Start to watch for reddit
            var watcher = RedditWatcher.GetInstance();

            // Print out news to telegram
            watcher.OnNewsUpdated += telegramClient.NotifyUsers;

            watcher.StartWatch();
            Console.ReadLine();
        }