create account

Mastobot: For your Fediverse PHP posting needs by crell

View this thread on: hive.blogpeakd.comecency.com
· @crell ·
$16.50
Mastobot: For your Fediverse PHP posting needs
Like much of the world I've been working to migrate off of Twitter to Mastodon and the rest of the Fediverse.  Along with a new network is the need for new automation tools, and I've taken this opportunity to scratch my own itch and finally build an auto-posting bot for my own needs.  And it is, of course, available as Free Software.

Announcing [Mastobot](https://github.com/Crell/mastobot)!  Your PHP-based Mastodon auto-poster.

## Different strategies

Mastobot runs on cron, and can post prepared status messages in either random order or in sequence.  It's also set up to support additional posting strategies as they are developed.

It currently cannot handle responding to messages; that would require it to accept incoming federated posts, which is a whole other problem space.  (Though I'm toying with that as well.)  For now, Mastobot is just a blind poster.

## Many formats

You can define posts for Mastobot in Text, JSON, or YAML format, depending on what post settings you want.  It supports multi-lingual posts, and all post visibilities, as well as content warnings/spoiler text.  See the documentation in the README for more details.

(Please respect your server's rules.)

## See it in action

I already have two instances set up on my own Mastobot instance.  One is configured to periodically post links to some of my old articles, or links to my book, [Thinking Functionally in PHP](https://leanpub.com/thinking-functionally-in-php/), to my [main Mastodon account](https://phpc.social/@Crell) on PHPC.social.

The second is a just-for-fun account, [@TOSSynopsis](https://botsin.space/@TOSSynopsis).  Inspired by the famous [@TNGSynopsis](https://twitter.com/TNGSynopsis) Twitter account, it's amusing summaries of Star Trek: The Original Series episodes.

I have a few other auto-poster accounts I have planned, which now that the bot exists are trivial to setup.  Just edit a YAMl file, put a bunch of text files in a directory, and you're good to go.

## PRs welcome!

The one main feature that isn't support yet is posting media along with the message.  The underlying Mastodon library I'm using, [colorfield/mastodon-api](https://github.com/colorfield/mastodon-api-php), doesn't have a clear API for doing so.  Unfortunately, the state of Mastodon client libraries in PHP is not great right now.  If we can figure out a good way to support attached media, I'm open to adding support or will accept PRs for the same.

Mastobot is AGPLv3 licensed, so everyone is free to run it for any account on any server.  At the moment it's in 0.3 status; I don't have any breaking changes planned, but some feature requests may necessitate some.  Consider it a beta release at the moment; usable with a bit of caution.

Happy Tooting!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 261 others
👎  ,
properties (23)
authorcrell
permlinkmastobot-for-your-fediverse-php-posting-needs
categoryhive-168588
json_metadata"{"app":"peakd/2023.1.1","format":"markdown","description":"Announcing Mastobot! Your PHP-based Mastodon auto-poster.","tags":["php","programming","fediverse","activitypub","mastodon"],"users":["Crell","TOSSynopsis","TNGSynopsis"],"image":[]}"
created2023-01-24 04:04:54
last_update2023-01-24 04:04:54
depth0
children2
last_payout2023-01-31 04:04:54
cashout_time1969-12-31 23:59:59
total_payout_value8.282 HBD
curator_payout_value8.217 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,749
author_reputation9,078,907,384,094
root_title"Mastobot: For your Fediverse PHP posting needs"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id120,145,731
net_rshares29,403,211,682,405
author_curate_reward""
vote details (327)
@pizzabot ·
<center>🍕 PIZZA !
 @crell! The Hive.Pizza team manually upvoted your post.

<sub>Please <a href="https://vote.hive.uno/@pizza.witness">vote for pizza.witness</a>!</sub></center>
👎  
properties (23)
authorpizzabot
permlinkre-mastobot-for-your-fediverse-php-posting-needs-20230124t045519z
categoryhive-168588
json_metadata"{"app": "beem/0.24.19"}"
created2023-01-24 04:55:18
last_update2023-01-24 04:55:18
depth1
children0
last_payout2023-01-31 04:55:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length177
author_reputation7,500,085,756,064
root_title"Mastobot: For your Fediverse PHP posting needs"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id120,146,611
net_rshares-3,957,550,987
author_curate_reward""
vote details (1)
@stemsocial ·
re-crell-mastobot-for-your-fediverse-php-posting-needs-20230124t171412900z
<div class='text-justify'> <div class='pull-left'>
 <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div>

Thanks for your contribution to the <a href='/trending/hive-196387'>STEMsocial community</a>. Feel free to join us on <a href='https://discord.gg/9c7pKVD'>discord</a> to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.&nbsp;<br />&nbsp;<br />
</div>
properties (22)
authorstemsocial
permlinkre-crell-mastobot-for-your-fediverse-php-posting-needs-20230124t171412900z
categoryhive-168588
json_metadata{"app":"STEMsocial"}
created2023-01-24 17:14:12
last_update2023-01-24 17:14:12
depth1
children0
last_payout2023-01-31 17:14:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length565
author_reputation22,911,435,184,347
root_title"Mastobot: For your Fediverse PHP posting needs"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id120,160,744
net_rshares0