Midnight Pub

Anyway to post here without using a web browser?

~257m

I usually read through midnight.pub through gemini and its inconvenient to have to open another separate browser just to post or reply here and so I usually don't. I know gemini user input is limited which is nice but I wonder if there is way to still participate?

Write a reply

Replies

~dsilverz wrote (thread):

It's a HTTP POST to /posts/save endpoint, containing a FormData with `title=the+title&content=the+content+%0D%0Awhich+can+be+split+into+multiple+lines+with+%0D%0Aescape+codes`. Such request could be replicated using curl or other command-line scripts.

The tricky part would be the authentication. The HTTP POST goes with a Cookie named `midn` which identifies your session. The authentication is done through /check-login endpoint, with FormData `name=the+username&password=the+password` and it theoretically returns a Set-Cookie header containing the `midn` session which could be used with /post/save.

However, as @samo pointed, there's already an official shellscript implementing it, so doing it manually without the official script would be overengineering.

~robotickyuu wrote (thread):

I have no idea, but I'd like to know too!! Gonna keep an eye on this post to see if anyone has answers