NAME

Bluesky - Bluesky Client Library in Perl

SYNOPSIS

use Bluesky;
my $bsky = Bluesky->new();
$bsky->login( 'sanko', '1111-2222-3333-4444' );
$bsky->createPost( ... );
# To be continued...

DESCRIPTION

You shouldn't need to know the AT protocol in order to get things done so I'm including this sugary wrapper so that At can remain mostly technical.

Constructor and Session Management

Bluesky.pm is my attempt to make use of Perl's class syntax so this is obviously OO.

new( ... )

my $bsky = Bluesky->new( 'sanko', '1111-2222-3333-4444' );

Expected parameters include:

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:

getTimeline( [...] )

$bsky->getTimeline();

Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed.

Expected parameters include:

getAuthorFeed( ... )

$bsky->getAuthorFeed( actor => 'sankor.bsky.social' );

Get a view of an actor's 'author feed' (post and reposts by the author).

Expected parameters include:

An error is returned if the client is blocked by the actor.

getPostThread( ... )

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

Returns an error if the thread cannot be found.

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:

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:

getLikes( ... )

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

createPost( ... )

$bsky->createPost( text => 'Test. Test. Test.' );

Create a new post.

Expected parameters include:

Note that a post may only contain one of the following embeds: image, video, embed_url, or embed_ref.

deletePost( ... )

$bsky->deletePost( 'at://did:plc:pwqewimhd3rxc4hg6ztwrcyj/app.bsky.feed.post/3lcdwvquo7y25' );

my $post = $bsky->createPost( ... );
...
$bsky->deletePost( $post->{uri} );

Delete a post or ensures it doesn't exist.

Expected parameters include:

like( ... )

$bsky->like( 'at://did:plc:pwqewimhd3rxc4hg6ztwrcyj/app.bsky.feed.post/3lcdwvquo7y25' );

$bsky->like( 'at://did:plc:totallymadeupgarbagehere/app.bsky.feed.post/randomexample', 'fu82qrfrf829crw89rfpuwcfiosdfcu8239wcrusiofcv2epcuy8r9jkfsl' );

Like a post publically.

Expected parameters include:

On success, a record is returned.

deleteLike( ... )

$bsky->deleteLike( 'at://did:plc:pwqewimhd3rxc4hg6ztwrcyj/app.bsky.feed.post/3lcdwvquo7y25' );

$bsky->deleteLike( 'at://did:plc:totallymadeupgarbagehere/app.bsky.feed.like/randomexample' );

Remove a like record.

Expected parameters include:

On success, commit info is returned.

Social Graph

Methods documented in this section deal with relationships between the authorized user and other members of the social network.

block( ... )

$bsky->block( 'sankor.bsky.social' );

Blocks a user.

Expected parameters include:

getBlocks( ... )

$bsky->getBlocks( );

Enumerates which accounts the requesting account is currently blocking.

Requires auth.

Expected parameters include:

Returns a list of actor profile views on success.

See Also

At - AT Protocol library

App::bsky - Bluesky client on the command line

https://docs.bsky.app/docs/api/

LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.

AUTHOR

Sanko Robinson sanko@cpan.org