add /rc/bin/ok, tool for okturing.com pastebin
This commit is contained in:
parent
171aafcc22
commit
4d9ce0fb3c
8
rc/bin/ok
Executable file
8
rc/bin/ok
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/rc
|
||||||
|
if(~ $#* 0)
|
||||||
|
file=/fd/0
|
||||||
|
if not
|
||||||
|
file=$1
|
||||||
|
hpost -u http://okturing.com -p / a_body@$file submit:submit fake:fake a_func:add_post url: |
|
||||||
|
grep -e '\/body\"' |
|
||||||
|
sed 1q | sed 's/^.*href=\"//g; s/body\".*$/body/g; s/^/http:\/\/okturing.com/g'
|
|
@ -1,6 +1,6 @@
|
||||||
.TH HGET 1
|
.TH HGET 1
|
||||||
.SH NAME
|
.SH NAME
|
||||||
hget, hpost, urlencode \- retrieve, post to a web page corresponding to a url
|
hget, hpost, ok, urlencode \- retrieve, post to a web page corresponding to a url
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B hget
|
.B hget
|
||||||
[
|
[
|
||||||
|
@ -48,6 +48,9 @@ hget, hpost, urlencode \- retrieve, post to a web page corresponding to a url
|
||||||
]
|
]
|
||||||
.I ...
|
.I ...
|
||||||
.PP
|
.PP
|
||||||
|
.B ok
|
||||||
|
.I file
|
||||||
|
.PP
|
||||||
.B urlencode
|
.B urlencode
|
||||||
[
|
[
|
||||||
.B -d
|
.B -d
|
||||||
|
@ -175,6 +178,13 @@ flag), the file has to be seekable as
|
||||||
.IR file (1)
|
.IR file (1)
|
||||||
is invoked to determine its mime type.
|
is invoked to determine its mime type.
|
||||||
.PP
|
.PP
|
||||||
|
.I Ok
|
||||||
|
uploads the contents either of its standard input or
|
||||||
|
.I file
|
||||||
|
to the pastebin website
|
||||||
|
.B http://okturing.com
|
||||||
|
and then prints a URL where the contents may be retrieved.
|
||||||
|
.PP
|
||||||
.I Urlencode
|
.I Urlencode
|
||||||
is a helper program to URL encode and decode files. The
|
is a helper program to URL encode and decode files. The
|
||||||
.B -d
|
.B -d
|
||||||
|
@ -209,20 +219,32 @@ Upload a file, print the resulting URL
|
||||||
.EX
|
.EX
|
||||||
% hpost -l http://i.intma.in file@/tmp/screen.png | rc
|
% hpost -l http://i.intma.in file@/tmp/screen.png | rc
|
||||||
.EE
|
.EE
|
||||||
|
.PP
|
||||||
|
Upload the output of
|
||||||
|
.IR ns (1)
|
||||||
|
to
|
||||||
|
.B http://okturing.com
|
||||||
|
.IP
|
||||||
|
.EX
|
||||||
|
% ns | ok
|
||||||
|
.EE
|
||||||
.SH SOURCE
|
.SH SOURCE
|
||||||
.B /rc/bin/hget
|
.B /rc/bin/hget
|
||||||
.br
|
.br
|
||||||
.B /rc/bin/hpost
|
.B /rc/bin/hpost
|
||||||
.br
|
.br
|
||||||
|
.B /rc/bin/ok
|
||||||
|
.br
|
||||||
.B /sys/src/cmd/urlencode.c
|
.B /sys/src/cmd/urlencode.c
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.IR webfs (4),
|
.IR webfs (4),
|
||||||
.IR ftpfs (4),
|
.IR ftpfs (4),
|
||||||
.IR file (1)
|
.IR file (1)
|
||||||
.SH DIAGNOSTICS
|
.SH DIAGNOSTICS
|
||||||
.I Hget
|
.I Hget ,
|
||||||
and
|
|
||||||
.I hpost
|
.I hpost
|
||||||
|
and
|
||||||
|
.I ok
|
||||||
require
|
require
|
||||||
.IR webfs (4)
|
.IR webfs (4)
|
||||||
service mounted on
|
service mounted on
|
||||||
|
|
Loading…
Reference in a new issue