Bluesky
view release on metacpan or search on metacpan
A callback subroutine invoked after a successful login. Receives the `$bsky` object as an argument.
## `firehose( $callback, [ $url ] )`
Returns a new [At::Protocol::Firehose](https://metacpan.org/pod/At%3A%3AProtocol%3A%3AFirehose) client for real-time streaming.
```perl
my $fh = $bsky->firehose(sub ($header, $body, $err) { ... });
$fh->start();
```
See [At::Protocol::Firehose](https://metacpan.org/pod/At%3A%3AProtocol%3A%3AFirehose) for more details.
# Feed and Content
Methods in this category create, modify, access, and delete content.
## `getTrendingTopics( [...] )`
```
$bsky->getTrendingTopics( );
```
Get a list of trending topics.
Expected parameters include:
- `viewer`
DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed
accounts in ranking.
- `limit`
Integer.
Default: `10`, Minimum: `1`, Maximum: `25`.
## `getTimeline( [...] )`
```
$bsky->getTimeline();
```
Get a view of the requesting account's home timeline. This is expected to some form of reverse-chronological feed.
Expected parameters include:
- `algorithm`
Variant 'algorithm' for timeline. Implementation-specific.
NOTE: most feed flexibility has been moved to feed generator mechanism.
- `limit`
Integer.
Default: `50`, Minimum: `1`, Maximum: `100`.
- `cursor`
## `getFeed( ... )`
```
$bsky->getFeed( 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/3l6oveex3ii2l' );
```
Get a hydrated feed from a feed generator.
## `getFeedSkeleton( ... )`
```
$bsky->getFeedSkeleton( 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/3l6oveex3ii2l' );
```
Get a feed skeleton (list of URIs) from a feed generator.
## `getAuthorFeed( ... )`
```perl
$bsky->getAuthorFeed( actor => 'sankorobinson.com' );
```
Get a view of an actor's 'author feed' (post and reposts by the author).
Expected parameters include:
- `actor` - required
AT-identifier for the author.
- `limit`
Integer.
Default: `50`, Minimum: `1`, Maximum: `100`.
- `cursor`
- `filter`
Combinations of post/repost types to include in response.
Known values:
- `posts_with_replies` - default
- `posts_no_replies`
- `posts_with_media`
- `posts_and_author_threads`
- `includePins`
Boolean value (false is default).
An error is returned if the client is blocked by the actor.
## `getPostThread( ... )`
```perl
$bsky->getPostThread( uri => 'at://bsky.app/app.bsky.feed.post/3l6oveex3ii2l' );
```
Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed
requests.
Expected parameters include:
- `uri` - required
Reference (AT-URI) to post record.
- `depth`
How many levels of reply depth should be included in response.
Default: `6`, Minimum: `0`, Maximum: `1000`.
- `parentHeight`
How many levels of parent (and grandparent, etc) post to include.
Default: `80`, Minimum: `0`, Maximum: `1000`.
Returns an error if the thread cannot be found.
## `getFeed( ... )`
```
$bsky->getFeed( 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/3l6oveex3ii2l' );
```
Get a hydrated feed from a feed generator.
## `getFeedSkeleton( ... )`
```
$bsky->getFeedSkeleton( 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/3l6oveex3ii2l' );
```
Get a feed skeleton (list of URIs) from a feed generator.
## `getPost( ... )`
```
$bsky->getPost('at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2');
```
Gets a single post view for a specified post (by AT-URI).
Expected parameters include:
- `uri` - required
AT-URI.
## `getPosts( ... )`
```
$bsky->getPosts(
'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l',
'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3lbvgvbvcf22c'
);
```
Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed
skeleton'.
Expected parameters include:
- `uris` - required
List of (up to 25) post AT-URIs to return hydrated views for.
## `getLikes( ... )`
```perl
$bsky->getLikes( uri => 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l' );
```
Get like records which reference a subject (by AT-URI and CID).
Expected parameters include:
- `uri` - required
AT-URI of the subject (eg, a post record).
- `cid`
CID of the subject record (aka, specific version of record), to filter likes.
- `limit`
Integer.
Default: 50, Minimum: 1, Maximum: 100.
- `cursor`
## `getBookmarks( ... )`
```
$bsky->getBookmarks();
```
Get private bookmarks for the authorized account.
## `createBookmark( ... )`
```
$bsky->createBookmark( 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l' );
```
Create a private bookmark for a post.
## `deleteBookmark( ... )`
```
$bsky->deleteBookmark( 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l' );
```
Delete a private bookmark.
## `getQuotes( ... )`
```perl
$bsky->getQuotes( uri => 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l' );
```
Get quotes of a post.
## `getActorLikes( ... )`
```perl
$bsky->getActorLikes( actor => 'sankorobinson.com' );
```
Get a list of posts liked by an actor.
## `searchPosts( ... )`
```perl
$bsky->searchPosts( q => 'perl' );
```
Find posts matching search criteria.
## `getSuggestedFeeds( ... )`
```
$bsky->getSuggestedFeeds();
```
Get suggested feed generators.
## `describeFeedGenerator( )`
```
If undefined, the post is fetched to gather this for you.
## `deleteRepost( ... )`
```
$bsky->deleteRepost( 'at://did:plc:pwqewimhd3rxc4hg6ztwrcyj/app.bsky.feed.repost/3lcdwvquo7y25' );
```
Remove a repost record.
## `uploadBlob( ... )`
```perl
$bsky->uploadBlob( $data, mime_type => 'image/png' );
```
Upload a blob (file/data) to the PDS. This is a wrapper around `uploadFile`.
# Social Graph
Methods documented in this section deal with relationships between the authorized user and other members of the social
network.
## `block( ... )`
```
$bsky->block( 'sankorobinson.com' );
```
Blocks a user.
Expected parameters include:
- `identifier` - required
Handle or DID of the person you'd like to block.
## `getBlocks( ... )`
```
$bsky->getBlocks( );
```
Enumerates which accounts the requesting account is currently blocking.
Requires auth.
Expected parameters include:
- `uri`
AT-URI of the subject (eg, a post record).
- `limit`
Integer.
Default: 50, Minimum: 1, Maximum: 100.
- `cursor`
Returns a list of actor profile views on success.
## `deleteBlock( ... )`
```
$bsky->deleteBlock( 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.block/3l6oveex3ii2l' );
```
Unblocks a user by removing the block record.
## `follow( ... )`
```
$bsky->follow( 'sankorobinson.com' );
```
Follows a user.
## `deleteFollow( ... )`
```
$bsky->deleteFollow( 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.follow/3l6oveex3ii2l' );
```
Unfollows a user by removing the follow record.
## `getFollows( ... )`
```
$bsky->getFollows( 'sankorobinson.com' );
```
Enumerates who an account is following.
## `getFollowers( ... )`
```
$bsky->getFollowers( 'sankorobinson.com' );
```
Enumerates who is following an account.
## `getKnownFollowers( ... )`
```
$bsky->getKnownFollowers( 'sankorobinson.com' );
```
Enumerates followers of an account that the authorized user also follows (mutuals).
## `getRelationships( ... )`
```perl
$bsky->getRelationships( actors => ['sankorobinson.com', 'bsky.app'] );
```
Enumerates relationships between the authorized user and other actors.
## `getMutes( ... )`
( run in 1.588 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )