- #!/bin/bash
- # annapaste paste a file to anna's pastebin
- filename="$1"
- title="$2"
- [[ -f /tmp/annapastefile.txt ]] && rm /tmp/annapastefile.txt
- if [[ "$filename" = "" ]];
- then
- while true;
- do
- echo -n "Enter the next line: "
- read ansread
- [[ "$ansread" = "" ]] && break
- echo $ansread >>/tmp/annapastefile.txt
- done
- else
- cp $filename /tmp/annapastefile.txt
- fi
- if [[ "$title" = "" ]];
- then
- echo -n "Enter the title: "
- read anstitle
- title="$(echo $anstitle|sed 's/"//g')"
- fi
- echo "curl -d title=\"$title\" -d name='anna' -d expire=0 --data-urlencode text@/tmp/annapastefile.txt https://anna.fyi/api/create"
- read
- curl -d title="$title" -d name='anna' -d expire=0 --data-urlencode text@/tmp/annapastefile.txt https://anna.fyi/api/create