summaryrefslogtreecommitdiff
path: root/src/imgreplacer.clj
diff options
context:
space:
mode:
authorScott Ostler <scottbot9000@gmail.com>2010-09-12 15:22:12 -0400
committerScott Ostler <scottbot9000@gmail.com>2010-09-12 15:22:12 -0400
commit4ea3e689f22bd3654343b8bdd5d0ede62c5cdf99 (patch)
treef40ae21b79d24036448bc874cc8f0a2aef40c27a /src/imgreplacer.clj
parent53772f312235b0a8743c94287b2a7417e8fd42a0 (diff)
Added hack to remove %20 from locally saved files
Diffstat (limited to 'src/imgreplacer.clj')
-rw-r--r--src/imgreplacer.clj6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/imgreplacer.clj b/src/imgreplacer.clj
index fe316c7..03ae0e6 100644
--- a/src/imgreplacer.clj
+++ b/src/imgreplacer.clj
@@ -33,7 +33,11 @@
string replacements))
(defn image-name [url]
- (format "%s-%s" (System/currentTimeMillis) (last (.split url "/"))))
+ (let [fname (last (.split url "/"))]
+ (format "%s-%s"
+ (System/currentTimeMillis)
+ ;; Hack: nginx doesn't like to serve images w/ spaces in them
+ (.replaceAll fname "%20" ""))))
(defn mirror-image [url]
(println "fetching" url)