summaryrefslogtreecommitdiffstats
path: root/fb
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2009-07-12 02:14:59 +0200
committerFlorian Pritz <f-p@gmx.at>2009-07-12 02:14:59 +0200
commit2572c8d2d1b8d804af53d6a772c1b358751a86ad (patch)
treee1edd2b47e6c90223bc7fd27371687dfa154a2f7 /fb
parent9dba52882d74d9c62ce9473ac9781f7ca6599fd2 (diff)
downloadbin-2572c8d2d1b8d804af53d6a772c1b358751a86ad.tar.gz
bin-2572c8d2d1b8d804af53d6a772c1b358751a86ad.tar.xz
rename filebin.sh and change domain
Diffstat (limited to 'fb')
-rwxr-xr-xfb32
1 files changed, 32 insertions, 0 deletions
diff --git a/fb b/fb
new file mode 100755
index 0000000..7dc48c9
--- /dev/null
+++ b/fb
@@ -0,0 +1,32 @@
+#!/bin/sh
+#----------------------------------------------------
+# Version: 0.2.3
+# Author: Florian "Bluewind" Pritz <f-p@gmx.at>
+#
+# Licensed under WTFPL v2
+# (see COPYING for full license text)
+#
+#----------------------------------------------------
+# Upload file to my filebin and copy URL to clipboard
+# or nopaste stdin
+# (only works if useragent contains libcurl)
+#----------------------------------------------------
+
+tmpfile=0
+if [ -n "$1" ]; then
+ file=$1
+else
+ file=$(mktemp)
+ tmpfile=1
+ while read -r input; do
+ echo "$input" >> $file
+ done
+fi
+
+URL=$(curl -# -L -F "userfile=@$file" http://paste.xinu.at/file/do_upload)
+echo $URL
+echo -n $URL | nohup &> /dev/null xclip
+
+if [ "$tmpfile" == "1" ]; then
+ rm $file
+fi