Esempio n. 1
0
        // Favourites
        public string GetFavoriteTweetsQuery(IGetUserFavoritesQueryParameters favoriteParameters)
        {
            _userQueryValidator.ThrowIfUserCannotBeIdentified(favoriteParameters.UserIdentifier);

            var userIdentifierParameter = _userQueryParameterGenerator.GenerateIdOrScreenNameParameter(favoriteParameters.UserIdentifier);
            var query = new StringBuilder(Resources.User_GetFavourites + userIdentifierParameter);

            var parameters = favoriteParameters.Parameters;

            query.AddParameterToQuery("include_entities", parameters.IncludeEntities);
            query.AddParameterToQuery("since_id", parameters.SinceId);
            query.AddParameterToQuery("max_id", parameters.MaxId);
            query.AddParameterToQuery("count", parameters.MaximumNumberOfTweetsToRetrieve);

            query.AddFormattedParameterToQuery(_queryParameterGenerator.GenerateTweetModeParameter(_tweetinviSettingsAccessor.CurrentThreadSettings.TweetMode));
            query.Append(_queryParameterGenerator.GenerateAdditionalRequestParameters(parameters.FormattedCustomQueryParameters));

            return(query.ToString());
        }
Esempio n. 2
0
        // Favourites

        public string GetFavoriteTweetsQuery(IGetUserFavoritesQueryParameters favoriteParameters)
        {
            if (!_userQueryValidator.CanUserBeIdentified(favoriteParameters.UserIdentifier))
            {
                return(null);
            }

            var userIdentifierParameter = _userQueryParameterGenerator.GenerateIdOrScreenNameParameter(favoriteParameters.UserIdentifier);
            var query = new StringBuilder(Resources.User_GetFavourites + userIdentifierParameter);

            var parameters = favoriteParameters.Parameters;

            query.AddParameterToQuery("include_entities", parameters.IncludeEntities);
            query.AddParameterToQuery("since_id", parameters.SinceId);
            query.AddParameterToQuery("max_id", parameters.MaxId);
            query.AddParameterToQuery("count", parameters.MaximumNumberOfTweetsToRetrieve);
            query.Append(_queryParameterGenerator.GenerateAdditionalRequestParameters(parameters.FormattedCustomQueryParameters));

            return(query.ToString());
        }
Esempio n. 3
0
        // Favourites
        public IEnumerable <ITweetDTO> GetFavoriteTweets(IGetUserFavoritesQueryParameters parameters)
        {
            var query = _userQueryGenerator.GetFavoriteTweetsQuery(parameters);

            return(_twitterAccessor.ExecuteGETQuery <IEnumerable <ITweetDTO> >(query));
        }
Esempio n. 4
0
 public IEnumerable<ITweet> GetFavoriteTweets(IGetUserFavoritesQueryParameters parameters)
 {
     var tweetDTOs = _userQueryExecutor.GetFavoriteTweets(parameters);
     return _tweetFactory.GenerateTweetsFromDTO(tweetDTOs);
 }
Esempio n. 5
0
 // Favourites
 public IEnumerable<ITweetDTO> GetFavoriteTweets(IGetUserFavoritesQueryParameters parameters)
 {
     var query = _userQueryGenerator.GetFavoriteTweetsQuery(parameters);
     return _twitterAccessor.ExecuteGETQuery<IEnumerable<ITweetDTO>>(query);
 }
 // Favourites
 public string GetFavoriteTweets(IGetUserFavoritesQueryParameters parameters)
 {
     var query = _userQueryGenerator.GetFavoriteTweetsQuery(parameters);
     return _twitterAccessor.ExecuteJsonGETQuery(query);
 }
Esempio n. 7
0
        public IEnumerable <ITweet> GetFavoriteTweets(IGetUserFavoritesQueryParameters parameters)
        {
            var tweetDTOs = _userQueryExecutor.GetFavoriteTweets(parameters);

            return(_tweetFactory.GenerateTweetsFromDTO(tweetDTOs));
        }
Esempio n. 8
0
        // Favourites
        public string GetFavoriteTweets(IGetUserFavoritesQueryParameters parameters)
        {
            var query = _userQueryGenerator.GetFavoriteTweetsQuery(parameters);

            return(_twitterAccessor.ExecuteGETQueryReturningJson(query));
        }
        // Favourites

        public string GetFavoriteTweetsQuery(IGetUserFavoritesQueryParameters favoriteParameters)
        {
            if (!_userQueryValidator.CanUserBeIdentified(favoriteParameters.UserIdentifier))
            {
                return null;
            }

            var userIdentifierParameter = _userQueryParameterGenerator.GenerateIdOrScreenNameParameter(favoriteParameters.UserIdentifier);
            var query = new StringBuilder(Resources.User_GetFavourites + userIdentifierParameter);

            var parameters = favoriteParameters.Parameters;

            query.AddParameterToQuery("include_entities", parameters.IncludeEntities);
            query.AddParameterToQuery("since_id", parameters.SinceId);
            query.AddParameterToQuery("max_id", parameters.MaxId);
            query.AddParameterToQuery("count", parameters.MaximumNumberOfTweetsToRetrieve);
            query.Append(_queryParameterGenerator.GenerateAdditionalRequestParameters(parameters.FormattedCustomQueryParameters));

            return query.ToString();
        }