Beispiel #1
0
        public async Task Should_Retrieve_Twits()
        {
            var query = Constants.Twitter.ToritoQuery;
            var recentSearchRequestParameters = new RecentSearchRequestParameters
            {
                Expansions = new List <string> {
                    Expansions.AuthorId, Expansions.GeoPlaceId
                },
                TweetFields = new List <string>
                {
                    TweetFields.AuthorId, TweetFields.CreatedAt, TweetFields.Text, TweetFields.Id, TweetFields.Geo, TweetFields.ContextAnnotations,
                    TweetFields.Entities
                }
            };
            var response = await _recentSearchService.GetRecentSearchAsync(query, recentSearchRequestParameters);

            Assert.NotNull(response.Data);
            Assert.NotEmpty(response.Data);
            Assert.NotEqual(default(int), response.Meta.Count);
        }
Beispiel #2
0
        public async Task <IList <Tweet> > GetTopToritoTweets(int count, CancellationToken ct = default)
        {
            var toritoQUery = Constants.Twitter.ToritoQuery;

            var request = new RecentSearchRequestParameters
            {
                MaxResults = count,
                Expansions = new List <string> {
                    Expansions.AuthorId, Expansions.GeoPlaceId
                },
                TweetFields = new List <string>
                {
                    TweetFields.AuthorId, TweetFields.CreatedAt, TweetFields.Text, TweetFields.Id, TweetFields.Geo, TweetFields.ContextAnnotations,
                    TweetFields.Entities
                }
            };

            var response = await _recentSearchService.GetRecentSearchAsync(toritoQUery, request, ct);

            var result = response.Data.ToList();

            return(result);
        }