-
Notifications
You must be signed in to change notification settings - Fork 2
CLI Usage
This is a guide to cover the 4 basic operations of a paest (create, read, update, delete) using curl.
# A static string
curl -F 'd=Hello world' a.pae.st
# A bash variable
curl -F 'd=$MyVar' a.pae.st
# A commands output
echo "Hello world" | curl -F 'd=<-' a.pae.st
# A file
curl -F 'd=@filename' a.pae.st
Updates, and Creates will give you back a response that looks like:
#Fragments(#) not required in url:
http://a.pae.st/XXX#CLI-PUBLIC
http://a.pae.st/XXX/YYYY#CLI-PRIVATE
http://pae.st/XXX#WEB-PUBLIC
http://pae.st/XXX/YYYY#WEB-PRIVATE
#[CLI|WEB]-[PUBLIC|PRIVATE] is the fragment, it's here to make grep/awk/sed easier to use
XXX is your paest id, it identifies your paest and is okay to share
YYYY is your private key, it is required to update or delete a paest.
To read a paest, simply curl it. With or without the private key or the fragment, it all works.
curl a.pae.st/XXX
curl a.pae.st/XXX/YYYY
curl a.pae.st/XXX/YYYY#ZZZ
After you make a paest and get your private url you can post to that url to update content.
curl -F 'd=Hello world' a.pae.st/XXX/YYYY
All of the usages listed in the create section work for updates.
Paests are automatically deleted after 1 week of inactivity. If you wish to delete a paest faster than that, simply post empty content to it.
curl -F 'd=' a.pae.st/XXX/YYYY
Use grep to pull out a specific key of interest
PAEST=$(./myProgram | curl -F '-d=<-' a.pae.st | grep 'CLI-PRIVATE')
You can post to any url. If it doesn't exist you get that url. If it does a randomly chosen url will be given to you.
echo "Hello world" | curl -F '-d=<-' a.pae.st/Special_Url | grep CLI-PRIVATE
http://a.pae.st/Special_Url/XWMRnUpnuJrmn59bD19m#CLI-PRIVATE
Similarly, you can choose your private key too
echo "Hello world" | curl -F '-d=<-' a.pae.st/Another_Url/My_Key | grep CLI-PRIVATE
http://a.pae.st/Another_Url/My_Key#CLI-PRIVATE