Created
April 21, 2011 15:05
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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