Leaf: Post to Libertree

with bash, vim and curl

index | bash

This script posts to Libertree, using bash, vim, and curl.

#!/bin/bash
# post to libertree
 
filedate=$(date +%m%d%y%H%M%S)
 
if [[ $(echo $*) ]]; then
        ud=$*
else
        vim ~/$filedate.leaf
        ud=$(cat ~/$filedate.leaf)
        mv ~/$filedate.leaf ~/Documents/fposts/
fi
 
if [[ $( curl -d "text=$ud" http://maple.libertreeproject.org/api/v1/posts/create?token=YOURAPITOKENHERE | grep error) ]]; then
        echo "Error"
else
        echo "Budding"
        echo $ud
fi

shortlink to this page: http://tonyb.us/leafpost

tonybaldwin 2012.06.02.10.55


~~DISQUS~~