Skip to content

Instantly share code, notes, and snippets.

@Licenser
Created April 8, 2010 20:21
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 Licenser/360493 to your computer and use it in GitHub Desktop.
Save Licenser/360493 to your computer and use it in GitHub Desktop.
(defn fetch-from
([url]
(try
(map #(if (= (last %) \/) [% (fetch-from (str url %))] %)
(map #(get-in % [:attrs :href])
(filter #(and
(= :a (:name %))
(= :start-element (:type %))
(not= \. (first (get-in % [:attrs :href])))) (parse-seq url nv-startparse))))
(catch Throwable e (println url))
(catch java.lang.RuntimeException e (println url))))
([] (fetch-from "http://clojars.org/repo/")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment