summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-09-11 17:49:27 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-09-11 17:49:27 +0200
commite76f369583c059c5ba1d68464886d9b33ed8a78e (patch)
treec9976832f130961415dfde46dac4bfe0e8394305
parent1c3d1e15e3c1dfd4086f077d2ed405acd94c8b5a (diff)
fetch history from server
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--fb.in17
1 files changed, 2 insertions, 15 deletions
diff --git a/fb.in b/fb.in
index d47105a..4a8d73c 100644
--- a/fb.in
+++ b/fb.in
@@ -22,7 +22,6 @@ TAREXT=".tar"
TAROPTS=""
DISPLAYHISTORY=
PASTEBIN="http://paste.xinu.at"
-FBHIST="$HOME/.fb-client.hist"
WARNSIZE=10485760
USERAGENT="fb-client/$VERSION"
CLIPBOARD=""
@@ -94,8 +93,6 @@ do_upload() {
echo $URL
if echo $URL | grep -qE "^https?://"; then
CLIPBOARD="$CLIPBOARD $URL"
- touch "$FBHIST"
- echo "$URL :: $basefilename :: `date +%s` :: `stat -c %s -- "$file"`" >> "$FBHIST"
fi
}
@@ -174,9 +171,7 @@ if [ "$DELETE" ] || [ "$GET" ]; then
for i in "$@"; do
i=$(id_from_arg "$i")
if [ "$DELETE" ]; then
- if $LIBDIR/fb-helper d "$PASTEBIN/file/delete/$i"; then
- sed -i "/$i/d" $FBHIST
- else
+ if ! $LIBDIR/fb-helper d "$PASTEBIN/file/delete/$i"; then
EXITCODE=1
fi
@@ -193,15 +188,7 @@ if [ "$DELETE" ] || [ "$GET" ]; then
fi
done
elif [ "$DISPLAYHISTORY" ]; then
- maxage=`echo 10*24*60*60 | bc`
- minsize=`echo 10*1024| bc`
-
- now=`date +%s`
- oldest_time=`echo "$now - $maxage" | bc`
-
- awk -F" :: " '
- ($4 < '$minsize' || $3 < '$oldest_time' ) { print $1" - \""$2"\" on "strftime("%a %b %d %H:%M:%S %Z %Y", $3)}
- ' $FBHIST
+ $LIBDIR/fb-helper d "$PASTEBIN/file/upload_history" || EXITCODE=1
elif [ $# -eq 0 ]; then
if [ "$TAR" ]; then