splitbrain/commie

Feature request: API

Closed this issue · 1 comments

It would be awesome to have a way to create posts from the command line.
Nothing fancy, a simple HTTP request handler would do just fine (something that would allow me to curl a file up and receive a 200 text/plain reply with the URL of the post)

There is nothing really needed to implement. Just do exactly what the browser does. This should get you started:

echo "hello world" | curl 'https://commie.io/lib/router.php?do=save' -d content="$(cat)"

The result is the hash of the newly created paste.