예제 #1
0
        public IActionResult Mentions(QueryUserViewModel queryUserViewModel)
        {
            if (ModelState.IsValid)
            {
                var model = new AnalysisViewModel
                {
                    Username = queryUserViewModel.TwitterHandle
                };

                var tweets = _twitterService.GetTweetsAsync(queryUserViewModel.TwitterHandle).Result;

                try
                {
                    model.AnalysisResults = _textAnalysis.AnalyzeTweets(tweets);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                return(View(model));
            }
            else
            {
                return(BadRequest());
            }
        }
예제 #2
0
        public IActionResult Index()
        {
            var model = new QueryUserViewModel();

            return(View(model));
        }