No activity today, make something!
tank-notes Privateer
Drop binaries into your tank here.

20140322125038 cdent  

Privateer is a plugin for tidldyweb that makes it possible to generate a special URI for a private tiddler that allows access without requiring authentication. The idea is that if you have some private content you would like to share with one person, you mint a special URI for them.

The access only works for GET requests and only for the one URI.

The first version of privateer was used on Tiddlyspace. That space provides information on the API.

Below is a simple script for pasting content to a tank and then returning a privateer URI. You will need to generate an API auth key.

#!/bin/sh 

# curl up the business for doing the whatsits

KEY='Your API Key Here'

TITLE=${1:-latestpaste}
HOST=${2:-https://tank.peermore.com}
BAG=${3:-Your Bag Here}

CONTENT=`echo; echo; cat`

URL=$HOST/bags/$BAG/tiddlers/$TITLE 

STATUS=`curl --silent /tmp/curlout -w %{http_code} -X PUT -H "X-Tank-Key: $KEY" \
    -H "Content-Type: text/plain" \
    --data-binary "type: text/plain$CONTENT" \
    $URL`

if [ "$STATUS" = "000201" ] || [ "$STATUS" = "000204" ]
then
    curl -s -i -X POST -H "X-Tank-Key: $KEY" -H "Content-Type: application/json" \
        --data-binary "{\"uri\": \"$URL\"}" \
        $HOST/_ |grep '^Location:'
else
    echo $STATUS
    exit 1
fi