Skip to content

Instantly share code, notes, and snippets.

@rippinrobr
Created April 21, 2011 15:05
Show Gist options
  • Select an option

  • Save rippinrobr/934721 to your computer and use it in GitHub Desktop.

Select an option

Save rippinrobr/934721 to your computer and use it in GitHub Desktop.
the hugo project's cmdline.clj file - used allow me to run the app from the cmd line
(ns cmdline
(:gen-class)
(:use hugo.parser)
(:use hugo.text-formatting))
(def *base-url* "http://www.thehugoawards.org/hugo-history/")
(defn prep-for-file
"Formats the output so it can be written correctly to the output file"
[rec]
(apply str (map #(str (format-output (first (hugo.parser/get-awards-per-year (:href %)))) "\n") rec)))
(defn -main [& args]
"Runs the parser and then writes the results to the output file"
(spit "hugo_awards_best_novels.txt"
(prep-for-file (take 12 (hugo.parser/get-award-links *base-url*)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment