コード例 #1
0
        public List <string> FetchTwitterFeed()
        {
            try
            {
                if (!System.IO.File.Exists(_userFilePath))
                {
                    return new List <string> {
                               "Error: user.txt does not exist please upload"
                    }
                }
                ;

                if (!System.IO.File.Exists(_tweetFilePath))
                {
                    return new List <string> {
                               "Error: tweet.txt does not exist please upload"
                    }
                }
                ;

                var userDictionary = _userService.BuildandRegisterUsers(_userFilePath, true);
                _tweetService.BuildTwitterFeed(_tweetFilePath, userDictionary);

                twitterFeed = _tweetService.RenderAllTwitterFeeds(userDictionary);
                return(twitterFeed);
            }
            catch (Exception ex)
            {
                return(new List <string> {
                    $"Error! {ex.Message}"
                });
            }
        }