Exemplo n.º 1
0
        public async Task <IActionResult> Index(TwittResult model)
        {
            if (string.IsNullOrWhiteSpace(model.Query))
            {
                return(View(model));
            }

            var twitter = new TwitterHelper
            {
                Key        = configuration.GetValue <string>("AppSettings:TwitterKey"),
                Secret     = configuration.GetValue <string>("AppSettings:TwitterSecret"),
                MaxResults = 30
            };

            model.Tweets = await twitter.GetTweetsByHashtags(model.Query);

            model.Query = twitter.Query;

            return(View(model));
        }