summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-08-17 13:22:51 +0200
committerFlorian Pritz <bluewind@xssn.at>2010-08-17 13:22:51 +0200
commit5a8a6f2a18ee7f23ee5fc5739ba56677026b72a5 (patch)
tree901e046f416ee2cb65fcc39275cfec7f519f6aaa
parentd979659e3a07cf64472ad1dc8fc9eda0e29ae787 (diff)
downloadaur-packages-5a8a6f2a18ee7f23ee5fc5739ba56677026b72a5.tar.gz
aur-packages-5a8a6f2a18ee7f23ee5fc5739ba56677026b72a5.tar.xz
update fb
Signed-off-by: Florian Pritz <bluewind@xssn.at>
-rw-r--r--fb-client/PKGBUILD4
-rw-r--r--fb-client/fb-0.5.3110
-rw-r--r--fb-client/fb-0.6.180
3 files changed, 2 insertions, 192 deletions
diff --git a/fb-client/PKGBUILD b/fb-client/PKGBUILD
index fc4a1b9..585a149 100644
--- a/fb-client/PKGBUILD
+++ b/fb-client/PKGBUILD
@@ -1,6 +1,6 @@
# Contributor: Florian "Bluewind" Pritz <flo@xssn.at>
pkgname=fb-client
-pkgver=0.6.7
+pkgver=0.6.7.1
pkgrel=1
pkgdesc="Client for paste.xinu.at"
arch=('any')
@@ -17,5 +17,5 @@ build() {
}
# vim:set ts=2 sw=2 et:
-md5sums=('d3a1a8f9659c04e470e580198f9a47d2'
+md5sums=('74699a89f5b06e09b1540e8bfe35a7c0'
'dcd8c4d69ca6c3eba9bee2599456e4ac')
diff --git a/fb-client/fb-0.5.3 b/fb-client/fb-0.5.3
deleted file mode 100644
index 98a5256..0000000
--- a/fb-client/fb-0.5.3
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/env python
-#----------------------------------------------------
-# Author: Florian "Bluewind" Pritz <flo@xssn.at>
-#
-# Licensed under WTFPL v2
-# (see COPYING for full license text)
-#
-#----------------------------------------------------
-# only works if useragent contains libcurl
-# Dependencies: python, curl
-# Optional: xclip
-#----------------------------------------------------
-
-'''[cat |] %prog [options] [file1 file2 ...]'''
-__version__ = '0.5.3'
-__desc__ = '''
-Upload/nopaste file/stdin to paste.xinu.at and copy URL to clipboard.
-~/.netrc: machine paste.xinu.at password PASSWORD
-'''
-
-from optparse import OptionParser
-from subprocess import Popen, PIPE
-from urllib2 import urlopen
-import os
-import sys
-import netrc
-import re
-
-def do_upload(file, extension=None):
- curl_args = []
- if extension:
- curl_args.append('-F')
- curl_args.append('extension=%s' % extension)
-
- url = Popen(merge([['curl', '-#', '-n', '-L', '-F', 'file=@%s' % file,
- ], curl_args, ['http://paste.xinu.at/file/do_upload']]),
- stdout=PIPE).communicate()[0].rstrip()
- print url
- Popen('echo -n "%s" | nohup >/dev/null xclip 2>&1' % url, shell=True)
-
-def get(id):
- print urlopen('http://paste.xinu.at/%s' % id).read()
-
-def merge(seq):
- merged = []
- for s in seq:
- for x in s:
- merged.append(x)
- return merged
-
-def read_stdin(tmpfile):
- if os.isatty(sys.stdin.fileno()):
- print '^C to exit, ^D to send'
- try:
- content = sys.stdin.read()
- except KeyboardInterrupt:
- sys.exit()
- if not content:
- sys.exit()
- tmpfile = tmpfile.replace('\n', '')
- f = open(tmpfile, 'w')
- f.write(content)
- f.close()
- return tmpfile
-
-def main():
- p = OptionParser(version=__version__,
- usage=__doc__,
- description=__desc__)
- p.add_option('-d', '--delete', action='store_true', dest='delete',
- help='delete IDs', default=False)
- p.add_option('-e', '--extension', action='store', dest='extension',
- help='extension for default highlighting (e.g. "diff")', default=None)
- p.add_option('-g', '--get', action='store_true', dest='get',
- help='Download File IDs and output to stdout (use with care!)', default=False)
- options, args = p.parse_args()
-
- tmpfiles = []
- tmpdir = Popen(['mktemp', '-d'], stdout=PIPE).communicate()[0]
- tmpdir = tmpdir.replace('\n', '')
- if args:
- for arg in args:
- if options.delete:
- Popen(['curl', '-#', '-n', '-L', 'http://paste.xinu.at/file/delete/%s' % arg]).communicate()[0]
- continue
-
- if options.get:
- get(arg)
- continue
-
- if re.match('[a-z]+://.+', arg):
- os.chdir(tmpdir)
- tmpfiles.append(tmpdir)
- Popen(['curl', '-#', '-O', arg]).communicate()[0]
- for file in os.listdir(tmpdir):
- do_upload(file, extension=options.extension)
- else:
- do_upload(arg, extension=options.extension)
- else:
- tmpfile = read_stdin(tmpdir+"/stdin")
- tmpfiles.append(tmpfile)
- do_upload(tmpfile, extension=options.extension)
-
- os.chdir('/tmp')
- for path in tmpfiles:
- Popen(['rm', '-rf', path])
- Popen(['rm', '-rf', tmpdir])
-
-if __name__ == '__main__':
- main()
diff --git a/fb-client/fb-0.6.1 b/fb-client/fb-0.6.1
deleted file mode 100644
index 06dd87e..0000000
--- a/fb-client/fb-0.6.1
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-#----------------------------------------------------
-# Author: Florian "Bluewind" Pritz <flo@xssn.at>
-#
-# Licensed under WTFPL v2
-# (see COPYING for full license text)
-#
-#----------------------------------------------------
-# only works if useragent contains libcurl
-# Dependencies: curl
-# Optional: xclip
-#----------------------------------------------------
-
-VERSION="0.6.1"
-
-DELETE=0
-EXTENSION=""
-GET=0
-PASTEBIN="http://paste.xinu.at"
-
-do_upload() {
- local EXTRA=""
- if [[ -n $EXTENSION ]]; then
- EXTRA="-F extension=$EXTENSION"
- fi
- URL="$(curl -# -n -L $EXTRA -F "file=@$1" "$PASTEBIN/file/do_upload")"
- echo $URL
- echo -n "$URL" | nohup &> /dev/null xclip
-}
-
-read_stdin() {
- if tty -s; then
- echo "^C to exit, ^D to send"
- fi
- cat > "$1"
-}
-
-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 " ~/.netrc: machine paste.xinu.at password PASSWORD"
- echo ""
- echo "Switches:"
- echo " -e EXTENSION extension for default highlighting (e.g. \"diff\")"
- echo " -d delete the IDs"
- echo " -g download the IDs and output on stdout (use with care!)"
- echo " -h this help"
- exit 0
-}
-
-while getopts ":e:gdh" OPTION; do
- case $OPTION in
- e) EXTENSION="$OPTARG";;
- g) GET=1;;
- d) DELETE=1;;
- h) help;;
- \?) echo "unknown option \"-$OPTARG\"" >&2; exit 1;;
- :) echo "Option \"-$OPTARG\" needs an argument" >&2; exit 1;;
- esac
-done
-
-shift $((OPTIND - 1))
-
-TMPDIR="$(mktemp -d "/tmp/fb.XXXXXX")"
-
-if (($# == 0)); then
- read_stdin "$TMPDIR/stdin"
- do_upload "$TMPDIR/stdin"
-else
- for i in "$@"; do
- if [[ $DELETE == 1 ]]; then
- curl -n -L "$PASTEBIN/file/delete/$i"
- elif [[ $GET == 1 ]]; then
- curl -s -o - "$PASTEBIN/$i"
- else
- do_upload $i
- fi
- done
-fi