This is the project repo for BluebirdPS, a Twitter automation client for PowerShell 7.
Please consider this a work in progress. At this point, anything and everything could be changed.
Though I have tried to keep errors at minimum, the user may encounter some. Please report any bugs in the BluebirdPS repo.
This module is still very much developed for the community and will gladly accept feedback from the community to make this module do what you need it to do, while adhering to the Twitter API design and PowerShell best practices.
In order to use this module, you will need to have PowerShell 7 installed and a Twitter Developer account and a Twitter Project/App created and request to API v2 Early Access.
In order to support cross-platform scenarios, PowerShell 7 was chosen as the version for this new module. Focusing on a single version will also allow us to forego handling the API calls differently between Windows PowerShell and PowerShell 7.
Please see Installing various versions of PowerShell for instructions on installing PowerShell 7. You can install it on virtually any modern operating system - Windows, MacOS, or Linux.
In order to use BluebirdPS, or any other Twitter API client or library, you will need to go through several steps to gain access to the API.
You must apply for a developer account at https://developer.twitter.com/en/apply-for-access. This process could take a couple weeks.
Next, activate your developer portal at https://developer.twitter.com/content/developer-twitter/en/portal/opt-in.
You must have a project with a developer app created in the portal.
Visit the Twitter API Getting Started page for details and additional links.
From the portal, you will need to generate the consumer key, otherwise called the API Key and Secret. The API Key is linked to your application.
You will also need to generate an Access Token and Secret. The Access Token is linked to your Twitter user account.
The application must be given access permissions of Read, Write, and Direct Message for full usage. At minimum, the application needs Read access for any Get- commands. Set-, Send-, and Publish-Tweet require Write access, while *-TwitterDM requires Direct Message access.
You can also generate a Bearer Token through the portal, or simply use the Set-TwitterAuthentication command. If your credentials are validated, the bearer token will be requested and set in the authentication file, as well.
Set-TwitterAuthentication
API Key: *************************
API Secret: **************************************************
Access Token: **************************************************
Access Token Secret: *********************************************
Start PowerShell 7 and run the following command:
Install-Module -Name BluebirdPS -Scope CurrentUser
For more information, please visit the BluebirdPS page on the PowerShell Gallery.
- Click here to go to the latest releases, then download the BluebirdPS.zip file attached to the release.
- Right-click the downloaded zip, select Properties, then unblock the file. This is to prevent having to unblock each file individually after unzipping.
- Unzip the archive.
- (Optional) Place the module somewhere in your PSModulePath.
- You can view the paths listed by running the environment variable
$env:PSModulePath
- You can view the paths listed by running the environment variable
- Clone repo to a folder of your choice.
- Change into the local repo folder.
- Install and Import Module
psake
,BuildHelpers
,PowerShellBuild
- Install dotnet (6.0)
- Run the
build.ps1
script. Import-Module -Path .\BuildOutput\BluebirdPS\<module version>\BluebirdPS.psd1
Search-Tweet -SearchString "(from:thedavecarroll)"
Get-Tweet -Id 1398279333823791104
Publish-Tweet -TweetText "A new release of #BluebirdPS will soon be released. BluebirdPS is #PowerShell 7 Twitter automation client. Check it out! https://bit.ly/BluebirdPS"
Get-TwitterList -Id 1397040831777984512 | Add-TwitterListMember -UserName thedavecarroll,BluebirdPS
- Rate limit based waiting period per endpoint
- Once a rate limit has been reached for a given endpoint, validate current time against rate limit reset time before making the call.
- Configuration value to enable/disable.
- Expand build scripts
- Pester tests
- TweetText processor (currently there no check for length)
- Exploration of PIN-OAuth