diff --git a/bin/urlencode b/bin/urlencode new file mode 100755 index 00000000..db976837 --- /dev/null +++ b/bin/urlencode @@ -0,0 +1,7 @@ +#!/usr/bin/env python +import os, sys, urllib +if os.isatty(file.fileno(sys.stdin)): + text = sys.argv[1] +else: + text = "".join(sys.stdin.readlines()) +print(urllib.quote_plus(text.strip()))