From 3285c1cc29bdfe315e54ad592d3855cc6017d098 Mon Sep 17 00:00:00 2001 From: creme Date: Tue, 14 Jan 2020 17:22:01 +0100 Subject: [PATCH] add also a alias --- fhost.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fhost.py b/fhost.py index 9eb271b..8bd37da 100755 --- a/fhost.py +++ b/fhost.py @@ -379,12 +379,12 @@ def fhost():

USAGE

HTTP POST files here: curl -F'file=@yourfile.png' {0} +post your text directly: + echo "text here" | curl -F'file=@-;' {0} you can also POST remote URLs: curl -F'url=https://example.com/image.jpg' {0} or you can shorten URLs: curl -F'shorten=http://example.com/some/long/url' {0} -post your text directly: - echo "text here" | curl -F'file=@-;' {0} file URLs are valid for at least 30 days and up to a year (see below). shortened URLs do not expire. @@ -419,11 +419,14 @@ you can also support it financially via liberapay. to make your life easier, you can add aliases to your .bash_aliases on Linux and .bash_profile on Mac OS X. just remember to reset your terminal session after that. 0file() { curl -F"file=@$1" {0} ; } +0pb() { curl -F'file=@-;' {0} ; } 0url() { curl -F"url=$1" {0} ; } 0short() { curl -F"shorten=$1" {0} ; } now you can use: -0file "yourfile.png" +0file "yourfile.png" +#35; or +echo "text here" | 0pb if you want a nice wrapper, try ~tomasino's pb