diff options
| author | Scott Ostler <scottbot9000@gmail.com> | 2010-09-12 15:22:12 -0400 |
|---|---|---|
| committer | Scott Ostler <scottbot9000@gmail.com> | 2010-09-12 15:22:12 -0400 |
| commit | 4ea3e689f22bd3654343b8bdd5d0ede62c5cdf99 (patch) | |
| tree | f40ae21b79d24036448bc874cc8f0a2aef40c27a | |
| parent | 53772f312235b0a8743c94287b2a7417e8fd42a0 (diff) | |
Added hack to remove %20 from locally saved files
| -rw-r--r-- | src/imgreplacer.clj | 6 |
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) |
