예제 #1
0
        private void Initialize()
        {
            try
            {
                _reddit  = new RedditFetcher(_logger);
                _twitter = new TwitterPoster(_logger, _fileManager, _trendFilePath, _appenTrend);

                var posts = _reddit.GetTopPosts(_reddit.GetSubreddit(_sub), _timeframe, _limit);
                _fileManager.SaveFile(posts, _filePath, true);
                _logger.Info("Successfully setup configuration\n");
            }
            catch (Exception ex)
            {
                _logger.Info("Error: " + ex.Message);
                _logger.Info(ex.StackTrace);
                ShutDown();
            }

            Process(DateTime.Now);
            StartTimer();
        }
예제 #2
0
 private void PurgeTwitterTimeline()         // Run this to erase timeline and start fresh
 {
     _twitter = new TwitterPoster(_logger, _fileManager, _trendFilePath, _appenTrend);
     _twitter.BulkDelete();
 }