Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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

In reply to Re: Anyone looking at Mastodon::Client? by cavac
in thread Anyone looking at Mastodon::Client? by Cody Fendant

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2023-06-09 01:24 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (35 votes). Check out past polls.