summaryrefslogtreecommitdiffstats
path: root/fb
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-06-21 15:03:35 +0200
committerFlorian Pritz <bluewind@xssn.at>2010-06-21 15:03:35 +0200
commit990a3519abed3b1c15e5ea5073518205cbdfe182 (patch)
treeaf79d732ae22cbb0ea40715e043e6a614b10976a /fb
parentc63464313fa34386a087e43a2f6c8e6f230c768b (diff)
downloadbin-990a3519abed3b1c15e5ea5073518205cbdfe182.tar.gz
bin-990a3519abed3b1c15e5ea5073518205cbdfe182.tar.xz
fb: copy all urls to clipboard if multiple uploads
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'fb')
-rwxr-xr-xfb10
1 files changed, 6 insertions, 4 deletions
diff --git a/fb b/fb
index cfd661c..8d4af3b 100755
--- a/fb
+++ b/fb
@@ -10,13 +10,14 @@
# Optional: xclip
#----------------------------------------------------
-VERSION="0.6.3.1"
+VERSION="0.6.3.2"
DELETE=0
EXTENSION=""
GET=0
PASTEBIN="http://paste.xinu.at"
USERAGENT="fb-client/$VERSION"
+CLIPBOARD=""
do_upload() {
local EXTRA=""
@@ -28,7 +29,7 @@ do_upload() {
sed '$d' $TMPFILE >&2
URL=$(tail -1 $TMPFILE)
echo $URL
- echo -n "$URL" | nohup &> /dev/null xclip || true
+ CLIPBOARD="$CLIPBOARD $URL"
}
read_stdin() {
@@ -41,7 +42,7 @@ read_stdin() {
help() {
echo "fb-client version $VERSION"
echo "usage: [cat |] $(basename "$0") [switches] [file(s)|ID(s)]"
- echo " Upload/nopaste file/stdin to paste.xinu.at and copy URL to clipboard."
+ echo " Upload/nopaste file(s)/stdin to paste.xinu.at and copy URL(s) to clipboard."
echo " ~/.netrc: machine paste.xinu.at password PASSWORD"
echo ""
echo "Switches:"
@@ -77,7 +78,7 @@ else
curl -n -L -A $USERAGENT "$PASTEBIN/file/delete/$i"
elif [[ $GET == 1 ]]; then
curl -s -o - -A $USERAGENT "$PASTEBIN/$i"
- elif [[ $i =~ ^(f|ht)tp(s)?://.+ ]]; then
+ elif grep -qE "^(f|ht)tp(s)?://.+" <<< "$i"; then
cd $TMPDIR
curl -# -A $USERAGENT -O "$i"
for f in *; do
@@ -89,3 +90,4 @@ else
done
fi
+echo -n "$CLIPBOARD" | nohup &> /dev/null xclip || true