himura / twitter-conduit

Twitter API package for Haskell, including enumerator interfaces and Streaming API supports.
BSD 2-Clause "Simplified" License
158 stars 48 forks source link

Support giving a count parameter to paginated user requests. #73

Closed srhoulam closed 4 years ago

srhoulam commented 4 years ago

Twitter allows supplying a 'count' parameter of up to 200 in paginated requests for users. Since this is 10 times the default amount of 20, this can be a great help for use cases that need to pull down many users, e.g., a spider. (https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friends-list)

I've changed UserParam into a record type with all fields optional, and used catMaybes in mkUserParam to build the parameters object from only what is specified. In this way, a user can specify either a UserId or a user screen name, and, optionally, a count if they wish to override the Twitter-side default of 20.

This is a draft PR until I give it some live testing, as my application isn't yet ready to go live.

srhoulam commented 4 years ago

Disregard this PR, I have since noticed the intended way to specify a count parameter for a request and will be using that instead.