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.