コード例 #1
0
        public IHttpActionResult GetByKeyword(string keyword, DateTime?startDate = null, DateTime?endDate = null)
        {
            startDate = startDate ?? DateTime.MinValue;
            endDate   = endDate ?? DateTime.Now.ToUniversalTime();

            var tweets = _TweetRepo.GetTweetsByKeyword(keyword, startDate.Value, endDate.Value, 100);

            return(Ok(tweets));
        }
コード例 #2
0
        public SentimentSeries GetSentimentByKeyword(string keyword, TimeLibrary.TimeInterval groupingInterval, DateTime startDate, DateTime endDate)
        {
            var tweets = _TweetRepo.GetTweetsByKeyword(keyword, startDate, endDate);

            var sentiment = _SentimentAnalyzer.GetSentiment(tweets, groupingInterval);

            var sentimentSeries = new SentimentSeries()
            {
                Keywords  = new[] { keyword },
                Sentiment = sentiment,
            };

            return(sentimentSeries);
        }