private void ButtonGo_Click(object sender, RoutedEventArgs e) { _blockTradeHarvester.Harvest(); string symbol = TextBoxSymbol.Text; if (string.IsNullOrWhiteSpace(symbol)) symbol= ComboBoxFavSymbols.SelectedItem.ToString(); DateTime from = DateTimeFrom.SelectedDate.Value.Date; DateTime to = DateTimeTo.SelectedDate.Value.Date.AddHours(23).AddMinutes(59).AddSeconds(59); var entries = new TweetProcessor().GetBlockTradeSummaries(symbol, from, to); DataGridBlockTrades.Items.Clear(); foreach (var blockTradeSummary in entries) { DataGridBlockTrades.Items.Add(blockTradeSummary); } var datedEntries = new TweetProcessor().GetBlockTradeSummariesByDate(symbol, from, to); DataGridBlockTradesByDate.Items.Clear(); foreach (var blockTradeSummary in datedEntries) { DataGridBlockTradesByDate.Items.Add(blockTradeSummary); } }
private void GetAndProcessTweets(string username) { long? sinceId = new TweetProcessor().GetMaxTweetId(); var param = Timeline.CreateUserTimelineRequestParameter(username); param.ExcludeReplies = true; param.IncludeEntities = false; param.MaximumNumberOfTweetsToRetrieve = 3200; param.TrimUser = true; if (sinceId.HasValue) param.SinceId = sinceId.Value; var tweets = Timeline.GetUserTimeline(param); ProcessTweets(tweets); if (null != tweets && tweets.Count() > 0) { var lastTweet = tweets.Last(); var lastTweetId = lastTweet.Id; GetAndProcessTweets(username, lastTweetId, sinceId); } }
private void ProcessTweets(IEnumerable<Tweetinvi.Core.Interfaces.ITweet> tweets) { if (null == tweets || tweets.Count() <= 0) return; TweetProcessor processor = new TweetProcessor(); foreach (var tweet in tweets) { processor.ProcessTweet(tweet as Tweetinvi.Logic.Tweet); } }