Bluesky
view release on metacpan or search on metacpan
## `oauth_start( $handle, $client_id, $redirect_uri, [ $scope ] )`
Initiates the OAuth 2.0 Authorization Code flow. Returns the authorization URL.
```perl
my $url = $bsky->oauth_start(
'user.bsky.social',
'http://localhost',
'http://127.0.0.1:8888/callback'
);
```
## `oauth_callback( $code, $state )`
Exchanges the authorization code for tokens and completes the OAuth flow.
```
$bsky->oauth_callback( $code, $state );
```
## `oauth_helper( %args )`
A high-level helper to manage the entire OAuth flow. This is the recommended way to authenticate for interactive
applications.
```perl
$bsky->oauth_helper(
handle => 'user.bsky.social',
listen => 1,
on_success => sub ($self) {
say 'Authenticated as ' . $self->did;
}
);
```
Expected parameters include:
- `handle` - required
The user's handle or DID.
- `listen`
Boolean. If true, attempts to start a local HTTP server (using [Mojolicious::Lite](https://metacpan.org/pod/Mojolicious%3A%3ALite)) to automatically capture the
`code` and `state` from the redirect.
- `redirect`
The redirect URI. Defaults to `http://127.0.0.1:8888/callback`.
- `scope`
The requested OAuth scopes. Defaults to `atproto chat.bsky.convo`.
- `on_success`
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( ... )`
```
( run in 0.461 second using v1.01-cache-2.11-cpan-5b529ec07f3 )