Skip to content

Instantly share code, notes, and snippets.

@srid
Created August 22, 2011 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srid/1163620 to your computer and use it in GitHub Desktop.
Save srid/1163620 to your computer and use it in GitHub Desktop.
s.clj
(str "http://api."
site
"/1.1/questions?fromdate="
fromdate
"&sort=votes&tagged="
tag)))
@ghoseb
Copy link

ghoseb commented Aug 23, 2011

I think it's better to use format for something like this.

(def *base-url* "http://api.%s/1.1/questions?fromdate=%s&sort=votes&tagged=%s")
(format *base-url* site fromdate tag)

@srid
Copy link
Author

srid commented Aug 23, 2011

thx - this looks better, though I wish clojure had ruby like formatting ... (format2 "api.#{site}/1.1/...")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment