Permalink
Browse files

new url shortener

  • Loading branch information...
1 parent bdfa45d commit 1e8bde92f2dd45bb7928d4db17de8ec48557ead1 @hiredman committed Aug 31, 2016
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/hiredman/utilities.clj
@@ -29,8 +29,12 @@
(defn shell [cmd]
(.. Runtime getRuntime (exec cmd)))
+;; (defn tinyurl [url]
+;; (-> "http://is.gd/api.php?longurl=%s" (format (URLEncoder/encode url))
+;; get-url))
+
(defn tinyurl [url]
- (-> "http://is.gd/api.php?longurl=%s" (format (URLEncoder/encode url))
+ (-> (format "http://tinyurl.com/api-create.php?url=%s" (URLEncoder/encode url))
get-url))
(def tinyurl (memoize tinyurl))

0 comments on commit 1e8bde9

Please sign in to comment.