shithub: rc

ref: f3afdf563f784c0a5703496f48c1a72dff4617f4
dir: /9paste/

View raw version
#!/bin/rc -e
rfork en

# usage: 9paste [.suffix] <file
# eg: topng </dev/screen | 9paste .png

if(! test -e /n/9paste/none)
	9fs 9paste

suf=$1
if(~ $"suf .png .jpg .jpeg .gif)
	t=I
if not
	t=0
x=`{randname}^$"suf
f=/n/9paste/none/$x

cat >$f

echo http://www.9paste.net/none/$x^'
'^gopher://gopher.9paste.net/$t/none/$x^'
'^$f >[1=2]