Created
August 3, 2015 08:15
-
-
Save ds0nt/2bef59c21710e017c358 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
quiptoken="UmVlQU1BWGh6QmQ=|1470115736|SdtQMKJViZWr2LWXWyajwNFIxmcaLqJ6if289R0SQaU=" | |
file=$HOME/human-fools | |
failure() { | |
echo "failure"; | |
exit 1; | |
} | |
# quip me | |
if [ ! -f $file ]; then | |
id=`curl https://platform.quip.com/1/threads/new-document \ | |
-d "content=#$(hostname)" \ | |
-d "format=markdown" \ | |
-H "Authorization: Bearer $quiptoken" \ | |
| grep -oE '"id"\:".*"' | grep -wEo '[^"id":]*'`; | |
echo $id > $file; | |
echo "http://quip.com/$id created"; | |
else | |
id=`cat $file`; | |
fi | |
echo -n "human-$USER: please summarize your activities: " | |
read answer | |
win=`curl https://platform.quip.com/1/threads/edit-document \ | |
-d "thread_id=$id" \ | |
-d "content=<p>$answer</p>" \ | |
-H "Authorization: Bearer $quiptoken" `; | |
echo "http://quip.com/$id edited"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment