I would like to announce BluebirdPS, a PowerShell 7 Twitter client.

BluebirdPS has been designed for the Standard track API v1.1 and v2:Early Access endpoints.

  • It is possible that you can create your own script to go against other endpoints and potentially other tracks, like the Academic Track, using the Invoke-TwitterRequest command.

Output will be rich objects (C# classes), converted from the API response. Most objects include a GetOriginalObject() method that contains the original API object*. Optionally, there is a global configuration setting that enables raw API output.

  • Under the hood, BluebirdPS uses Invoke-RestMethod which converts JSON into a PSCustomObject. This is considered raw output. You can always use ConvertTo-Json -Depth 10 if you needed raw JSON.

See the BluebirdPS Documentation for details.

I’d definitely appreciate any feedback or discussion.

Join the Discussion
Submit Issues
Submit Feature Requests

Currently, BluebirdPS does not support any stream endpoints.

Discover Command for Endpoint

Once downloaded, you can use the Get-TwitterApiEndpoint to discover which command to use for a given endpoint.

Some commands may support multiple endpoints based on which parameters are used.

Let’s say you want to know which command(s) uses any blocking endpoint, you can use the following statement to see the list, complete with the URL for the API documentation page.

PS > Get-TwitterApiEndpoint -Endpoint blocking | Format-List
CommandName      : Get-TwitterBlockedUser
Visibility       : Public
ApiEndpoint      : {GET /2/users/:id/blocking}
ApiDocumentation : {https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/get-users-blocking}

CommandName      : Set-TwitterBlockedUser
Visibility       : Public
ApiEndpoint      : {POST /2/users/:id/blocking, DELETE /2/users/:source_user_id/blocking/:target_user_id}
ApiDocumentation : {https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/post-users-user_id-blocking,
                   https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/delete-users-user_id-blocking}

BluebirdPS Help

Each BluebirdPS command has extensive help with examples that you can access via PowerShell’s Get-Help command.

Get-TwitterFriends

PS > Get-Help -Name Get-TwitterFriends -Examples
NAME
    Get-TwitterFriends

SYNOPSIS
    Returns a collection of Twitter users that e specified user follows.


    -------------------------- Example 1 --------------------------

    PS > Get-TwitterFriends

    Returns the users followed by the authenticating user.
    -------------------------- Example 2 --------------------------

    PS > Get-TwitterFriends -Id 1330877955057344513

    Returns the users followed by the specified user.
    -------------------------- Example 3 --------------------------

    PS > Get-TwitterUser -User BluebirdPS | Get-TwitterFriends

    Returns the users followed by the user returned by Get-TwitterUser.

Search-Tweet

Get-Help Search-Tweet -Examples
NAME
    Search-Tweet

SYNOPSIS
    Returns a collection of relevant Tweets matching a specified query.


    -------------------------- Example 1 --------------------------

    PS > Search-Tweet -SearchString '(from:thedavecarroll) (#BluebirdPS)'

    Id                 : 1395753890352701446
    Text               : @mikefrobbins @karlprosser @sunnyc7 @PSHOrg @JeffHicks @PowerTip @Josh_Atwell @ravikanth @ScriptWarrior @SAPIENTech @MaxTrinidad
    The #PSFollowFriday Tweet brought to you by #BluebirdPS. https://t.co/9ZRyGjusRq
    Attachments        : MediaInfo
    AuthorId           : 292670084
    ContextAnnotations :
    ConversationId     : 1395747574317998080
    CreatedAt          : 5/21/2021 2:50:33 PM
    Entities           : {#PSFollowFriday, #BluebirdPS, @mikefrobbins, @karlprosser…}
    Geo                :
    InReplyToUserId    : 292670084
    Language           : en
    NonPublicMetrics   :
    OrganicMetrics     :
    PossiblySensitive  : False
    PromotedMetrics    :
    PublicMetrics      : RetweetCount: 0, ReplyCount: 0, LikeCount: 1, QuoteCount: 0
    ReferencedTweets   : {1395747574317998080}
    ReplySettings      : Everyone
    Source             : BluebirdPS
    Withheld           :

    Returns a collection of relevant Tweets matching a specified query.

Command List

Command listing with corresponding endpoints.

2 Likes

@andypiper I finally got BluebirdPS client to the point where I felt it was ready for introduction here.

Thanks.

BluebirdPS v0.5.1 has been released to the PowerShellGallery.

This is a bugfix release which corrects a few small issues, one relating to initial module import.

Run ‘Update-Module -Name BluebirdPS’ or see bit.ly/BluebirdPSDoc to get started today!

1 Like

This is so cool! Thanks for sharing here!

1 Like

Thanks! I’m definitely looking for feedback.

1 Like

BluebirdPS v0.6.1 has been released to PowerShellGallery.

This release includes importing authentication data from environment variables.

Run ‘Update-Module -Name BluebirdPS’ or see bit.ly/BluebirdPSDoc to get started today!

2 Likes

BluebirdPS v0.6.2 has been released to the PowerShellGallery.

This release includes a couple pagination fixes.

Run ‘Update-Module -Name BluebirdPS’ or see bit.ly/BluebirdPSDoc to get started today!

2 Likes

BluebirdPS v0.7.0 has been released to the PowerShellGallery.

What’s New

The v0.7.0 release of BluebirdPS includes the following:

  • Adds new command, Get-TweetCount, which corresponds to the recently released GET /tweets/count/recent endpoint.
  • Removes configuration value for RawOutput. This capability is replaced by new configuration value OutputType.
  • Fixes parameter sets for Publish-TwitterDM and parameter validation for several commands.
  • Fixes Get-TwitterApiEndpoint filter for CommandName.
  • Publish-TwitterDM now allows users to send a message only, message and media, or media only.
  • Adds ToString() override for Tweet and User object classes.
  • Adds new configuration value OutputTypewith values of ‘CustomClasses’, ‘PSCustomObject’, or ‘JSON’. This will allow a user to specify the format for API output.

Run ‘Update-Module -Name BluebirdPS’ or see bit.ly/BluebirdPSDoc to get started!

3 Likes

Thank you so much for tracking the API updates, Dave! Fantastic.

4 Likes

Thank you for API update am looking for its many thanks

BluebirdPS v0.8.1 has been released to the PowerShellGallery.

What’s New

The v0.8.1 release of BluebirdPS includes the following:

  • Fixes Publish-Tweet fails to render response

The v0.8.0 release of BluebirdPS includes the following:

  • Converts List commands to Twitter API v2 endpoints.

  • Converts Muted User commands to Twitter API v2 endpoints.

  • Adds commands for Pinned List endpoints.

  • Adds Edit Controls and Edit History to Tweet object classes.

  • Fixes Media class to include Url and AltText properties.

  • Removes GetOriginalObject() from Context and BaseMetrics.

  • Adds OutputType to most commands.

  • Add Metrics exception class.

  • Add Get-BluebirdPSVersion to display the imported version of BluebirdPS.

  • Add Get-BluebirdPSAssemblyDetails to assist with class discovery.

  • Add Show-TwitterAuthentication to assist with authentication validation.

Run ‘Update-Module -Name BluebirdPS’ or see bit.ly/BluebirdPSDoc to get started!

1 Like