Beispiel #1
0
        public async Task ExtractTweetsFromTimelineAsync(string timelineUrl)
        {
            List <Tweet> tweets = new List <Tweet>();

            var extractor = new TweetExtractor(new HttpClient());
            await extractor.ExtractTweetsFromTimelineAsync(
                new TimelineExecutionInfo
            {
                TimelineUrl = timelineUrl
            },
                canExecute : () => tweets.Count <= 20,
                onTweetsExtracted : results => tweets.AddRange(results));

            foreach (var t in tweets)
            {
                log.WriteLine(t.ToString());
            }

            Assert.NotEmpty(tweets);
        }
Beispiel #2
0
        public async Task SearchTweetsAsync(string title)
        {
            List <Tweet> tweets = new List <Tweet>();

            var extractor = new TweetExtractor(new HttpClient());
            await extractor.SearchTweetsAsync(
                new SearchExecutionInfo
            {
                Query = title
            },
                canExecute : () => tweets.Count <= 20,
                onTweetsExtracted : results =>
            {
                tweets.AddRange(results);
            });

            foreach (var t in tweets)
            {
                log.WriteLine(t.ToString());
            }

            Assert.NotEmpty(tweets);
        }