public/helper/Get-TwitterCollections_List.ps1
function Get-TwitterCollections_List { <# .SYNOPSIS Curate a collection of Tweets .DESCRIPTION GET collections/list Find Collections created by a specific user or containing a specific curated Tweet. Results are organized in a cursored collection. .PARAMETER user_id The ID of the user for whom to return results. .PARAMETER screen_name The screen name of the user for whom to return results. .PARAMETER tweet_id The identifier of the Tweet for which to return results. .PARAMETER count Specifies the maximum number of results to include in the response. Specify a count between 1 and 200. A next_cursor value will be provided in the response if additional results are available. .PARAMETER cursor A string identifying the segment of the current result set to retrieve. Values for this parameter are yielded in the cursors node attached to response objects. Usage of the count parameter affects cursoring. .NOTES This helper function was generated by the information provided here: https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/get-collections-list #> [CmdletBinding()] Param( [string]$user_id, [string]$screen_name, [string]$tweet_id, [string]$count, [string]$cursor ) Begin { [hashtable]$Parameters = $PSBoundParameters $CmdletBindingParameters | ForEach-Object { $Parameters.Remove($_) } [string]$Method = 'GET' [string]$Resource = '/collections/list' [string]$ResourceUrl = 'https://api.twitter.com/1.1/collections/list.json' } Process { # Find & Replace any ResourceUrl parameters. $UrlParameters = [regex]::Matches($ResourceUrl, '(?<!\w):\w+') ForEach ($UrlParameter in $UrlParameters) { $UrlParameterValue = $Parameters["$($UrlParameter.Value.TrimStart(":"))"] $ResourceUrl = $ResourceUrl -Replace $UrlParameter.Value, $UrlParameterValue } $OAuthSettings = Get-TwitterOAuthSettings -Resource $Resource Invoke-TwitterAPI -Method $Method -ResourceUrl $ResourceUrl -Parameters $Parameters -OAuthSettings $OAuthSettings } End { } } |