Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReturnValue parameter to Invoke-TwitterCursorRequest #8

Closed
thedavecarroll opened this issue Oct 11, 2020 · 0 comments
Closed

Add ReturnValue parameter to Invoke-TwitterCursorRequest #8

thedavecarroll opened this issue Oct 11, 2020 · 0 comments
Assignees

Comments

@thedavecarroll
Copy link
Owner

Add a ReturnValue parameter to Invoke-TwitterCursorRequest.

This will allow for tidier code in the public functions.

Instead of wrapping the returned values in an array and returning the required property like this:

$TwitterFollowers = Invoke-TwitterCursorRequest -OAuthParameters $OAuthParameters
@($TwitterFollowers.ids)

or this:

@(Invoke-TwitterCursorRequest -OAuthParameters $OAuthParameters).ids

You can simple provide the property as the ReturnValue, like this:

Invoke-TwitterCursorRequest -OAuthParameters $OAuthParameters -ReturnValue ids

This is a typical return for ids and users from a cursored request.

ids                 : {…}
next_cursor         : 0
next_cursor_str     : 0
previous_cursor     : 0
previous_cursor_str : 0
total_count         :

users               : {@{}...}
next_cursor         : 0
next_cursor_str     : 0
previous_cursor     : 0
previous_cursor_str : 0
total_count         :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant