mkellerman / PSTwitterAPI

PSTwitterAPI - a PowerShell module for the Twitter API
https://mkellerman.github.io/Introducing_PSTwitterAPI/
45 stars 13 forks source link

Remove the requirement for both $Resource and $ResourceURL parameters #9

Closed mkellerman closed 5 years ago

mkellerman commented 5 years ago

In the function Invoke-TwitterAPI, we require 2 parameters:

Name Example
$Resource /statuses/update
$ResourceUrl https://api.twitter.com/1.1/statuses/update.json

$Resource is used to find the RateLimitStatus on that resource. And $ResourceUrl is used to build the OAuthSettings.

But some resources are like this:

    [string]$Resource    = '/geo/id/:place_id'
    [string]$ResourceUrl = 'https://api.twitter.com/1.1/geo/id/:place_id.json'

And I need to replace :place_id in the ResourceUrl with the actual value of the place_id parameter.

    [string]$ResourceUrl = https://api.twitter.com/1.1/geo/id/df51dec6f4ee2b2c.json

I suspect that I will need to generate the $Resource from the $ResourceUrl. If I don't find a resource with the full text, then look for partial match.

I would like to have to only supply one parameter, so less parameters are required to do manual Invoke-TwitterAPI commands.