public/helper/Send-TwitterCollections_EntriesRemove.ps1
function Send-TwitterCollections_EntriesRemove { <# .SYNOPSIS Curate a collection of Tweets .DESCRIPTION POST collections/entries/remove Remove the specified Tweet from a Collection. Use POST collections / entries / curate to remove Tweets from a Collection in bulk. .PARAMETER id The identifier of the target Collection. .PARAMETER tweet_id The identifier of the Tweet to remove. .NOTES This helper function was generated by the information provided here: https://developer.twitter.com/en/docs/tweets/curate-a-collection/api-reference/post-collections-entries-remove #> [CmdletBinding()] Param( [string]$id, [string]$tweet_id ) Begin { [hashtable]$Parameters = $PSBoundParameters $CmdletBindingParameters | ForEach-Object { $Parameters.Remove($_) } [string]$Method = 'POST' [string]$Resource = '/collections/entries/remove' [string]$ResourceUrl = 'https://api.twitter.com/1.1/collections/entries/remove.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 { } } |