diff options
author | Florian Pritz <f-p@gmx.at> | 2008-12-19 12:28:37 +0100 |
---|---|---|
committer | Florian Pritz <f-p@gmx.at> | 2008-12-19 12:28:37 +0100 |
commit | 2c6e3fddb3d0a3a95afd395c16f119def05e2a28 (patch) | |
tree | baa5861620685e9269d8e572fc14bcd868ab56aa /xup.sh | |
parent | 915a6da8b9fc8db6044a8a8676fdc64691f0b4ab (diff) | |
download | bin-2c6e3fddb3d0a3a95afd395c16f119def05e2a28.tar.gz bin-2c6e3fddb3d0a3a95afd395c16f119def05e2a28.tar.xz |
forgot to update some time...
Diffstat (limited to 'xup.sh')
-rwxr-xr-x | xup.sh | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,37 @@ +#!/bin/sh +#----------------------------------------------------# +# File: xup.sh +# Version: 0.1.1 +# Date: 2008-12-14 +# Author: Florian "Bluewind" Pritz <f-p@gmx.at> +# Upload file to XUP, copy URL to clipboard and +# save to historyfile +#----------------------------------------------------# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +XUPHIST="${HOME}/.xup_history" +FILE=$(basename $1) +DIR=$(dirname $1) +cd $DIR + +URLS=$(curl -# -F "F1=@$FILE" -L "http://www.xup.in/xtrans.php" -H "Expect: ") +DL_URL=$(echo -n ${URLS} | ack -o "\"http://www.xup.in/dl,.{8}/$FILE/\"" | sed "s#\"##g") +DEL_URL=$(echo -n ${URLS} | ack -o "\"http://www.xup.in/kill,.{8},.{10}/\"" | sed "s#\"##g") + +echo $(date) >> $XUPHIST +echo "$PWD/$FILE" >> $XUPHIST +echo $DL_URL >> $XUPHIST +echo -n $DL_URL | xclip +echo $DEL_URL >> $XUPHIST +echo "" >> $XUPHIST |