Bluesky

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

    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`

## `getAuthorFeed( ... )`

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

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

Expected parameters include:

README.md  view on Meta::CPAN

- `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`

README.md  view on Meta::CPAN

- `cid`

    CID of the subject record (aka, specific version of record), to filter likes.

- `limit`

    Integer.

    Default: 50, Minimum: 1, Maximum: 100.

- `cursor`

## `createPost( ... )`

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

Create a new post.

Expected parameters include:

README.md  view on Meta::CPAN

- `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.

# See Also

[At](https://metacpan.org/pod/At) - AT Protocol library

[App::bsky](https://metacpan.org/pod/App%3A%3Absky) - Bluesky client on the command line

[https://docs.bsky.app/docs/api/](https://docs.bsky.app/docs/api/)

lib/Bluesky.pm  view on Meta::CPAN

Variant 'algorithm' for timeline. Implementation-specific.

NOTE: most feed flexibility has been moved to feed generator mechanism.

=item C<limit>

Integer.

Default: C<50>, Minimum: C<1>, Maximum: C<100>.

=item C<cursor>

=back

=head2 C<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:

lib/Bluesky.pm  view on Meta::CPAN

=item C<actor> - required

AT-identifier for the author.

=item C<limit>

Integer.

Default: C<50>, Minimum: C<1>, Maximum: C<100>.

=item C<cursor>

=item C<filter>

Combinations of post/repost types to include in response.

Known values:

=over

=item C<posts_with_replies> - default

lib/Bluesky.pm  view on Meta::CPAN

=item C<cid>

CID of the subject record (aka, specific version of record), to filter likes.

=item C<limit>

Integer.

Default: 50, Minimum: 1, Maximum: 100.

=item C<cursor>

=back

=head2 C<createPost( ... )>

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

Create a new post.

Expected parameters include:

lib/Bluesky.pm  view on Meta::CPAN

=item C<uri>

AT-URI of the subject (eg, a post record).

=item C<limit>

Integer.

Default: 50, Minimum: 1, Maximum: 100.

=item C<cursor>

=back

Returns a list of actor profile views on success.

=head1 See Also

L<At> - AT Protocol library

L<App::bsky> - Bluesky client on the command line

t/000_compile.t  view on Meta::CPAN

                    field displayName => E();
                    field link        => D();
                    field topic       => D();
                    end;
                };
                end
            };
            end
        }, 'getTrendingTopics( ... )';
        is my $timeline = $bsky->getTimeline(), hash {
            field cursor => D();
            field feed   => D();    # Feed items are subject to change
            end;
        }, 'getTimeline( )';
        is my $authorFeed = $bsky->getAuthorFeed( actor => 'bsky.app' ), hash {
            field cursor => E();
            field feed   => D();    # Feed items are subject to change
            end;
        }, 'getAuthorFeed( ... )';
        is my $postThread = $bsky->getPostThread( uri => 'at://bsky.app/app.bsky.feed.post/3l6oveex3ii2l' ), hash {
            field thread     => D();
            field threadgate => E();
            end;
        }, 'getPostThread( ... )';
        is my $stable_post = $bsky->getPost('at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l'), hash {
            field author      => D();

t/000_compile.t  view on Meta::CPAN

            ),
            array {
            item 0 => D();
            item 1 => D();
            end;
            }, 'getPosts( ... )';
        is my $likes = $bsky->getLikes( uri => 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l' ), hash {
            field cid    => E();
            field likes  => array {etc};
            field uri    => D();
            field cursor => E();
            end
        }, 'getLikes( ... )';

        #~ ddx $likes;
        #~ p my $ys   = $bsky->getLikes( uri => 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l' );
        my $post;
        subtest createPost => sub {
            is $post = $bsky->createPost( text => 'Post is for #testing only. @atproto.bsky.social https://wikipedia.com/' ), hash {
                field cid    => D();
                field commit => hash {

t/000_compile.t  view on Meta::CPAN

                    diag 'giving Bluesky a moment to catch up...';
                    sleep 2;
                }
                ok $ok, 'displayName has changed';
            }
        }
    };
    subtest 'pull author feed' => sub {
        $login || skip_all "$login";
        is my $feed = $bsky->getAuthorFeed( actor => 'did:plc:z72i7hdynmk6r22z27h6tvur', filter => 'posts_and_author_threads', limit => 30 ), hash {
            field cursor => D();
            field feed   => D();    # Feed items are subject to change
            end;
        }, 'getAuthorFeed( ... )';
    };
    subtest 'pull post thread' => sub {
        $login || skip_all "$login";
        is my $thread = $bsky->getPostThread( uri => 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l2s5xxv2ze2c' ), hash {
            field threadgate => E();
            field thread     => meta {    # Feed items are subject to change
                prop isa     => 'At::Lexicon::app::bsky::feed::defs::threadViewPost';

t/000_compile.t  view on Meta::CPAN

                    prop blessed => 'At::Lexicon::app::bsky::feed::defs::postView'
                };
                end;
            };
            end;
        }, 'getPost( ... )';
    };
    subtest 'pull reposts' => sub {
        $login || skip_all "$login";
        is my $reposts = $bsky->getRepostedBy( uri => 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l2s5xxv2ze2c' ), hash {
            field cursor     => D();
            field cid        => E();
            field repostedBy => D();    # array
            field uri        => D();    # AT-uri
            end;
        }, 'getRepostedBy( ... )';
    };
    {
        my $post;
        subtest 'post plain text content' => sub {
            $login || skip_all "$login";

t/000_compile.t  view on Meta::CPAN

                    field rev => D();
                    end;
                };
                etc;
            }, 'deletePost(...)';
        };
    }
    subtest 'get our own follows' => sub {
        $login || skip_all "$login";
        is my $follows = $bsky->getFollows( $bsky->did ), hash {
            field cursor  => E();
            field follows => D();    # array of At::Lexicon::app::bsky::actor::defs::profileView objects
            field subject => D();    # profileview
            end;
        }, 'getFollows( ... )';
    };
    subtest 'get our own followers' => sub {
        $login || skip_all "$login";
        is my $followers = $bsky->getFollowers( $bsky->did ), hash {
            field cursor    => E();
            field followers => D();    # array of At::Lexicon::app::bsky::actor::defs::profileView objects
            field subject   => D();    # profileview
            end;
        }, 'getFollowers( ... )';
    };
    {
        my $follow;
        subtest 'follow myself' => sub {
            $login || skip_all "$login";
            is $follow = $bsky->follow( $bsky->did ), hash {



( run in 0.247 second using v1.01-cache-2.11-cpan-4d50c553e7e )