Midnight Pub

Testing Post-From-Shell


This is just a test. I haven't had much free time lately, but I wanted to try this out. Smudge says hi.

I did have to edit my copy to use getopt instead of getopts since I'm on OpenBSD and not GNU/Linux, but I suppose a symlink would have served equally well. I also had to change the shebang because bash doesn't live in /bin on OpenBSD.

Here's my version.

#!/usr/bin/env bash


if [ $# -eq 0 ]
    curl -F title="$(head -1 /dev/stdin)"\
	 -F content="$(tail -n +2 /dev/stdin)"\
	 -b midn="$(cat ~/.config/.midnight)"\

while getopt "r:t:" OPTION; do
    case $OPTION in
	    curl -F reply="$(cat /dev/stdin)"\
		 -b midn="$(cat ~/.config/.midnight)"\
	    curl -F reply="$(cat /dev/stdin)"\
		 -b midn="$(cat ~/.config/.midnight)"\
            echo "Incorrect options provided"
            exit 1

Unfortunately, while I got the script to run it still doesn't work for me. Here are my results.

/home/starbreaker/bin/midnight: line 8: -F: command not found
/home/starbreaker/bin/midnight: line 10: https://midnight.pub/posts/save: No such file or directory
/home/starbreaker/bin/midnight: line 9: -b: command not found
/home/starbreaker/bin/midnight: line 30: syntax error near unexpected token `done'
/home/starbreaker/bin/midnight: line 30: `done'
kether:/home/starbreaker/internet/midnight.pub$ curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information

I guess I'll stick with posting from the browser for now since it wouldn't be fair to expect ~m150 to set up an OpenBSD virtual machine just to make sure midnight.sh works for me.

Besides, "cat testing-midnight-sh.gmi | xclip" works well enough for me.


You're displaying " for " , is that there in the version on your system too? That might explain why the curl line is apparently not interpreted as one continuing line.



Dammit, I should have seen that. *facepalm*