@trovenewsbot has been around for more than eleven years now – originally sharing Trove newspaper articles on Twitter, and now on the Fediverse. But with the imminent closure of the botsin.space Mastodon instance, I’ve had to find it a new home. Say hello to the latest version: @trovenewsbot@wraggebots.net!
Instead of just moving the bot to an existing instance, I decided to set up my own using GoToSocial. I thought this would give me more control, and encourage me to resurrect some more of my old Twitter bots. I installed GoToSocial on the smallest available DigitalOcean droplet, following the ‘bare metal’ instructions. Beyond the usual faffing around with permissions and DNS, I didn’t have any major problems. The GoToSocial documention is very comprehensive, and includes useful advice on things like setting up a firewall.
GoToSocial is a social network server based on the ActivityPub standard. It’s not the same as Mastodon, but because it supports the same standards, it interoperates with Mastodon. For example, once I had a @trovenewsbot account set up on wraggebots.net, I was able to use the standard migrate functions to move all of the bot’s existing followers to the new instance. Easy peasy!
The bot’s code makes use of the mastodon.py Python library, but again because of the similarities between the GoToSocial and Mastodon APIs, I was able to reuse the code with only minor changes. Specifically, I found that I had to add the parameter version_check_mode = "none"
to the Mastodon client initialisation. The notifications_dismiss()
method is not currently implemented in GoToSocial, so I also had to change the way I check for new notifications – saving the id of the last viewed notification, and then using it as the value for since_id
when requesting a list of current notifications.
@trovenewsbot does a lot more than post random newspaper articles from Trove. By tooting keywords at it, you can search Trove from within the Fediverse. There are many options available for customising your queries, see the documentation for full details.