💾 Archived View for midnight.pub › posts › 381 captured on 2023-01-29 at 05:23:44. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-12-03)
-=-=-=-=-=-=-
I changed midnight.sh to post the contents of a file which is given as first argument, instead of from stdin. Run like "bash ./midnight.sh post.txt ". The file should contain: title, one blank line, body.
--form-string instead of -F to read the text as literal; I had some problems with semicolons read as field seperators in the posting form
Haven't gotten to the reply and thread options yet.
#!/bin/bash host=https://midnight.pub if [ $# -eq 1 ] then file=$1 echo "$(sed -n '1p' $file)" echo "$(tail -n +2 $file)" curl --form-string title="$(sed -n '1p' $file)"\ --form-string content="$(tail -n +2 $file)"\ -b midn="$(cat ~/.config/.midnight)"\ $host/posts/save fi
If I'm reading this right, it's also loading your login credentials from a local file?