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.
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 usedcatMaybes
inmkUserParam
to build the parameters object from only what is specified. In this way, a user can specify either aUserId
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.