Skip to content

thedavecarroll/BluebirdPS

Repository files navigation

BluebirdPS: A Twitter Automation Client for PowerShell 7

BluebirdPS This is the project repo for BluebirdPS, a Twitter automation client for PowerShell 7.

PowerShell Gallery Downloads PowerShell Gallery Version (including pre-releases)

Standard v2

No Longer Active

Due to the recent changes with the Twitter API primarily regarding the new tiers, I will no longer continue developing this project. It should be considered stale and no new versions will be released. The latest version, v0.8.4, seeks to correct an issue in the Free Tier with Publish-Tweet.

This module will allow you to tweet, retweet, send direct messages, manage lists, and more, if you pay for the Basic or Pro Tiers. Otherwise, you should be able to tweet and delete tweets if using the Free Tier.

See Twitter API Documentation for details.

Community Module

This module was developed for the community and accepted feedback from the community to make it what it had become.

Pre-requisites

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.

PowerShell 7

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.

Developer Account, Project, App, and Access Tokens

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.

Applying for a Developer Account

You must apply for a developer account at https://developer.twitter.com/en/apply-for-access. This process could take a couple weeks.

Activate Developer Portal

Next, activate your developer portal at https://developer.twitter.com/content/developer-twitter/en/portal/opt-in.

Create a Project and Register a Developer App

You must have a project with a developer app created in the portal.

Apply for Access for the Twitter API v2: Early Access

Visit the Twitter API Getting Started page for details and additional links.

Generate Account Tokens

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: *********************************************

How to Install

From the PowerShell Gallery

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.

From the GitHub Release Page

  1. Click here to go to the latest releases, then download the BluebirdPS.zip file attached to the release.
  2. Right-click the downloaded zip, select Properties, then unblock the file. This is to prevent having to unblock each file individually after unzipping.
  3. Unzip the archive.
  4. (Optional) Place the module somewhere in your PSModulePath.
    • You can view the paths listed by running the environment variable $env:PSModulePath

Building from the GitHub Repo

  1. Clone repo to a folder of your choice.
  2. Change into the local repo folder.
  3. Install and Import Module psake, BuildHelpers, PowerShellBuild
  4. Install dotnet (6.0)
  5. Run the build.ps1 script.
  6. Import-Module -Path .\BuildOutput\BluebirdPS\<module version>\BluebirdPS.psd1

Examples

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