๐ Uploading blog programmatically
I am a lazy person spending most of their time in a terminal ๐ป...
This is one of the reasons why lmno.lol really suites me.. I update my markdown locally, drag it on the edit page, click save, boom, done ๐!
Since I don't want to move out of my terminal, I hacked a little script using curl to upload my blog programmatically.
lmno.lol is protected by a cookie based authentication system. The first thing to do is to login with the username and password. Luckily the login screen is a form I can submit with curl with roughly this command:
After storing the cookie session key, we can now move to the next step, which is uploading a new version of lmno.lol/crisidev!
Today I learned something wild!
I was inspecting the Firefox console during the blog upload phase, after clicking save on
https://lmno.lol/crisidev/edit and I found the API POST call to https://lmno.lol/api
that is responsible to update my blog.
I click on the request and ๐ฅ
I am crying of joy.
Update my blog
Mozilla produces a working curl command that I had to tweak a little to basically this:
Easy!
The result
Auto publish anyone? ๐คฉ
The blog is a self-contained Github repo and is published
to lmno.lol/crisidev using a
Github action
based on the learnings above so that every time I update it the repository and push on main,
the CI kicks in and a new version is published automatically ๐
The code
Here is the full script, which is shared also as a gist.




