summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrc/bin/tinyurl7
-rw-r--r--sys/man/1/tinyurl13
2 files changed, 20 insertions, 0 deletions
diff --git a/rc/bin/tinyurl b/rc/bin/tinyurl
new file mode 100755
index 000000000..da4b695e0
--- /dev/null
+++ b/rc/bin/tinyurl
@@ -0,0 +1,7 @@
+#!/bin/rc
+if(! ~ $#* 1) {
+ echo usage: tinyurl http://research.swtch.com/2008/02/hideous-name.html >[1=2]
+ exit usage
+}
+hget http://tinyurl.com/api-create.php?url'='$1
+echo
diff --git a/sys/man/1/tinyurl b/sys/man/1/tinyurl
new file mode 100644
index 000000000..3dd548817
--- /dev/null
+++ b/sys/man/1/tinyurl
@@ -0,0 +1,13 @@
+.TH TINYURL 1
+.SH NAME
+tinyurl \- shrink a URL
+.SH SYNOPSIS
+.B tinyurl
+.I URL
+.SH DESCRIPTION
+.I Exchanges
+a long URL for a shorter URL utilizing the API at tinyurl.com.
+.SH SOURCE
+.B /rc/bin
+.SH BUGS
+Redesigns of the source website can break this program.