MightyNetwork::Plugin::Helpers - Provides helpers for MightyNetwork
MightyNetwork::Plugin::Helpers inherits all methods from Mojolicious::Plugin and implements the following new ones.
Returns a Mojo::Pg object to allow database querying.
Uses Mojolicious::Plugin::PgURLHelper.
my $dbi = $c->dbi;
Returns the string of the WebFinger URL for searching $account
on $host
.
my $wf_url = $c->wf_url('framapiaf.org', 'framasky@framapiaf.org');
Returns an UUID by querying the PostgreSQL database.
my $uuid = $c->generate_uuid;
Fetches the URL of an ActivityPub actor (see MightyNetwork::DB::ActivityPub::Actor) from a WebFinger URL.
Returns an hash table:
{ actor_url => $actor_url, errors => \@errors }
$actor_url
is the ActivityPub URL of the actor.
\@errors
is an array reference containing encountered errors.
my $wf_url = $c->wf_url('framapiaf.org', 'framasky@framapiaf.org');
my $hash = $c->get_actor_url($wf_url);
Fetches ActivityPub actor (see MightyNetwork::DB::ActivityPub::Actor) informations.
Uses get_actor_url under the hood.
Returns an hash table:
{ actor => $actor, errors => \@errors }
$actor
is a MightyNetwork::DB::ActivityPub::Actor object.
\@errors
is an array reference containing encountered errors.
my $wf_url = $c->wf_url('framapiaf.org', 'framasky@framapiaf.org');
my $hash = $c->get_actor_from_url('framapiaf.org', 'framasky', $wf_url);
MightyNetwork, MightyNetwork::Plugin, Mojolicious::Plugin, Mojo::Pg, Mojolicious::Plugin::PgURLHelper, MightyNetwork::DB::ActivityPub::Actor