I’ve been trying for long to get more involved with Common Lisp as I’ve felt for quite some time that it’s a language with a very nice balance of expressiveness and practicality. Together with the great experience of developing interactively with slime and the huge collection of libraries that exist I think that delving in Common Lisp will be pretty exciting.
After having read Practical Common Lisp (although not yet fully digested the knowledge) and having solved some Advent of Code challenges I thought about writing a bot for announcing my blog-posts in fediverse and specifically in https://pleroma.soykaf.com/. After some research I found this blog-spot that gave a lot of info on achieving almost the same goal I had.
The base for the bot is two of Shinmera’s libraries, and drakma:
- tooter, a library that implements the Mastodon REST Api (that is compatible with the one from pleroma)
- plump, a great parser for HTML/XML like markups
- drakma, a full-featured HTTP client
The above libraries constitute a great foundation for creating any kind of bot for the fediverse. The code for my bot can be found here and is quite easy to adapt in a series of ways to achieve different results.
Then with cron we can run it once every day by executing:
sbcl --eval "(ql:quickload 'pleroma-bot)" --eval "(quit)"
Common Lisp starts to steal my mind!