ebb/ssbpost.sh

29 lines
673 B
Bash
Executable File

#!/bin/bash
#ok so this script should take an argument of an image and posts it
#add blob
blobID=$(cat $1 | ssb-server blobs.add) || exit 1
#echo $blobID
#publish blob
#key=$(ssb-server publish --type post --text "![upload.bmp($blobID)]"
#ssb-server publish --type post --text "a new photo from #dweb-camp 2022! ![photo.bmp]($blobID)" --mentions.0.name photo.jpg --mentions.0.type image/bmp --mentions.0.link
ssb-server publish . <<EOF
{
"type":"post",
"text":"a new photo from #dweb-camp 2022! ![photo.jpg]($blobID)",
"mentions": [
{
"name": "photo.jpg",
"type": "image/jpeg",
"link": "$blobID"
},
{"link":"#dweb-camp"}
]
}
EOF