App-bsky
view release on metacpan or search on metacpan
lib/App/bsky.pm view on Meta::CPAN
}
else {
$self->say( 'DID: %s', $profile->did->_raw );
$self->say( 'Handle: %s', $profile->handle->_raw );
$self->say( 'DisplayName: %s', $profile->displayName // '' );
$self->say( 'Description: %s', $profile->description // '' );
$self->say( 'Follows: %d', $profile->followsCount );
$self->say( 'Followers: %d', $profile->followersCount );
$self->say( 'Avatar: %s', $profile->avatar ) if $profile->avatar;
$self->say( 'Banner: %s', $profile->banner ) if $profile->banner;
$self->say('Blocks you: yes') if $profile->viewer->blockedBy // ();
$self->say('Following: yes') if $profile->viewer->following // ();
$self->say('Muted: yes') if $profile->viewer->muted // ();
}
1;
}
method cmd_updateprofile (@args) {
GetOptionsFromArray(
\@args,
'avatar=s' => \my $avatar,
t/01_client.t view on Meta::CPAN
like is_say { client->run(qw[followers]) }, qr[deal.bsky.social], 'followers';
like is_say { client->run(qw[followers --json]) }, qr[^\[\{], 'followers --json';
like is_say { client->run(qw[followers --handle sankor.bsky.social]) }, qr[atproto.com], 'followers --handle sankor.bsky.social';
like is_say { client->run(qw[followers --json --handle sankor.bsky.social]) }, qr["bsky.app"],
'followers --json --handle sankor.bsky.social';
like is_say { client->run(qw[followers --json -H sankor.bsky.social]) }, qr["bsky.app"], 'followers --json -H sankor.bsky.social';
};
subtest 'follow/unfollow' => sub {
skip_all 'sankor.bsky.social is already followed; might be a race condition with another smoker'
if is_say { client->run(qw[follows]) } =~ qr[sankor.bsky.social];
skip_all 'sankor.bsky.social is blocked and cannot be followed; might be a race condition with another smoker'
if is_say { client->run(qw[blocks]) } =~ qr[sankor.bsky.social];
sleep 1;
like is_say { client->run(qw[follow sankor.bsky.social]) }, qr[at://did:plc:pwqewimhd3rxc4hg6ztwrcyj/app.bsky.graph.follow],
'follow sankor.bsky.social';
sleep 1;
like is_say { client->run(qw[follows]) }, qr[sankor.bsky.social], 'follows';
sleep 1; # sometimes the service has to catch up
like is_say { client->run(qw[unfollow sankor.bsky.social]) }, qr[at://did:plc:pwqewimhd3rxc4hg6ztwrcyj/app.bsky.graph.follow],
'unfollow sankor.bsky.social';
sleep 1;
t/01_client.t view on Meta::CPAN
sleep 1; # sometimes the service has to catch up
like is_say { client->run(qw[unfollow did:plc:2lk3pbakx2erxgotvzyeuyem]) },
qr[at://did:plc:pwqewimhd3rxc4hg6ztwrcyj/app.bsky.graph.follow], 'unfollow did:plc:2lk3pbakx2erxgotvzyeuyem';
};
todo 'using random images pulled from the web... things may go wrong' => sub {
like is_say {
client->run(qw[update-profile --avatar https://cataas.com/cat?width=100 --banner https://cataas.com/cat?width=1000])
}, qr[did:plc:pwqewimhd3rxc4hg6ztwrcyj], 'update-profile --avatar ... --banner ...';
};
subtest 'block/unblock' => sub {
skip_all 'sankor.bsky.social is already blocked; might be a race condition with another smoker'
if is_say { client->run(qw[blocks]) } =~ qr[sankor.bsky.social];
#~ skip_all 'testing!';
todo 'service might be low updating profile info...' => sub {
like is_say { client->run(qw[block sankor.bsky.social]) }, qr[at://did:plc:pwqewimhd3rxc4hg6ztwrcyj/app.bsky.graph.block],
'block sankor.bsky.social';
};
sleep 1; # sometimes the service has to catch up
like is_say { client->run(qw[blocks]) }, qr[sankor.bsky.social], 'blocks';
like is_say { client->run(qw[unblock sankor.bsky.social]) }, qr[at://did:plc:pwqewimhd3rxc4hg6ztwrcyj/app.bsky.graph.block],
( run in 0.517 second using v1.01-cache-2.11-cpan-49f99fa48dc )