Python wrapper for WriteFreely API

Hello there :slight_smile:
I was creating a plugin for a Delta Chat bot that allows me to publish to my WriteFreely blog right from the Delta Chat app, and in the processes, not really happy with the libs I found to work with, I have created a Python wrapper for the WriteFreely API myself:

Aiming to be simple to use and well documented (docs strings, type annotations, etc.)

To install it just run:

 pip install writefreely-py

Best regards,
adb

2 Likes

This is so great to see @adbenitez! Thanks for creating this library. I mostly use Python myself so I’ll definitely give it a spin.

Would love to see the Delta Chat bot plugin too! We have some users who use chat apps along with Write.as so maybe it’d open the door to other plugins like it.

1 Like

hi @cjeller1592, here is the plugin:

Delta Chat is a chat application that looks like Telegram, WhatsApp, etc. but actually it uses email in the background and it is compatible with other email apps, so this actually means the plugin can also work to post-by-email in WriteFreely with Thunderbird, K9Mail, etc.

Currently the plugin is made so only the bot admin can bridge with WriteFreely, but it can be easily adapted to allow anyone to login in a public bot instance.

How it works?

  1. you send the bot a message in the chat app (users can also login with user + password, but for a 3rd party bot not host by yourself if better to provide a token):
    /login https://write.as MY-TOKEN
  2. the bot then creates a group chat for each of your collections/blogs (each group named as your respective blogs) the groups are groups of two members (you and the bot) and any message you send in this groups, for example in group “my-blog” each message sent to this group is posted to “my-group” blog, etc.

this could be improved with an instance-specific bot configured to work with write.as as instance and then users just sent a private message with a token to the bot and get logged in, so it is easier to use.