I have just posted this text to the Delta Chat discussion board.
A Delta Chat based comment system for an static blog
Hi,
I wanted to share a project I’ve been working on: Només 5 Línies (which translates to "Only 5 Lines"). It is a microblog where the entire publishing workflow happens directly inside Delta Chat.
I wanted a way to blog that felt as immediate as sending a chat message but without giving up data sovereignty or relying on walled gardens. Until now I was using a Telegram channel, but Telegram is very shady and I cannot trust it. Furthermore, Pavel Durov can read everything. I cannot support that platform, even for a public microblog/channel.
The result is a system where I simply send a message to my bot, and it automatically publishes it to the open web.
The core of the system is a Python bot that sits on a personal computer running 24/7. It acts as a bridge and a static site generator.
1. I write a post as a regular message in Delta Chat. I can include photos.
2. The bot (using deltachat-rpc-client) receives the message. It verifies if the sender is authorized (me) and extracts the text and media.
3. Then the bot publishes the message:
* The website is static and sitting in a cheap shared hosting service. It was important for me for it to be static as I don't want to have any security maintenance: The bot updates a JSON database and triggers a static site builder made ad-hoc for this site. It generates HTML pages for the new post, updates the index, and rebuilds the RSS feed. It then deploys the changes to my web server via rsync.
* Telegram Mirror: It simultaneously forwards the content to a Telegram channel for subscribers there. But my plan is to remove the telegram channel soon.
* Delta Chat Channel: The content is also broadcasted to a Delta Chat channel.
But, what’s a blog without comments? And how can I have comments with a static website generator? Well, it is easy!
* Each post on the website has a "Comment via Delta Chat" link.
* When a new post is created, the bot creates a dedicated Delta Chat group for that specific post.The "comment via Delta Chat" link is the invitation link to the group. Any message sent to this group, appears below the post.
* User's can delete their posts by deleting their comments from the group.
I also have an open Delta Chat group where the bot posts all the blog posts and comments. There, anyone can post. It is the microblog's watercooler. I'm looking forward for Delta Chat to improve it's support for open public groups.
The project is currently running live at n5l.illadelaire.org (https://n5l.illadelaire.org) (content is in Catalan). Some things need to improve though.
This thing could be implemented thanks to "Codex CLI" and "Gemini CLI". I'm a scientist and I'm quite good writing scientific software to analyze data, but I'm not sure I would have done this project without AI.
In any case. The thing works like a charm and it is thanks to Delta Chat! I would like to thank its developers.
Comentaris
Comenta mitjançant Delta Chat
Thank you for your service! 🫡
This is a very interesting experiment and I think the idea is really clever. Thank you!
Thanks for coming 😀! The fun part is that it was very easy to implement.
Delta Chat is a great tool.
I may have missed it, but is the source code of the bot available?
No. It Is not available yet. I want to finish some things first. Then I have to separate the logic from the content. Now everything is in the same repo. But once I've done this, I'll publish the code.
Testing comment (can it be modified?) 🤯
The test worked. Welcome. 😀
is it possible for the bot to send link to the article? Just to refresh where the memory. For now, here is the link: https://n5l.illadelaire.org/posts/1124.html#comments
Irvan, it would be a good idea for the bot to send the comment's URL back to the sender.
Testing image
Oops, editing turns out worked!
Deleting also worked!
Testing replying to my previous message
Reactions are not supported
Deleted messages should show as "deleted message" instead of disappearing completely. I will change that (sort of like in WhatsApp).
Yeah that's reasonable to show that the message shown as "deleted message". Perhaps also need "edited" shown too.
As in this message.
Yes. It is in my pending list.
Thanks, this is a great showcase!
I really enjoyed doing this.