in reply to Anyone looking at Mastodon::Client?
Well, my bot does it something like this:
print "Connecting to Mastodon...\n"; my $client = Mastodon::Client->new( instance => $config->{server}, name => 'TotallyLegitBot', client_id => $config->{key}, client_secret => $config->{secret}, access_token => $config->{token}, coerce_entities => 1, ); print "Posting message...\n"; $client->post_status('Dear Sir! I am prince Bob of Nigeria and i have +an offer for you...');
Hope that helps.
EDIT: For authentication, i went to my Mastodon account to Preferences/Development, clicked on "New Application", filled in application name and clicked submit. Then click the link with that application again and you get key+secret+token that you give your application. There are probably other ways to authorize it, but that's the one i found works without problems and with the least fuzzing about.
PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Anyone looking at Mastodon::Client?
by Cody Fendant (Hermit) on Dec 20, 2022 at 07:15 UTC | |
by cavac (Vicar) on Dec 20, 2022 at 14:22 UTC |
In Section
Seekers of Perl Wisdom