Skip to content
Browse files

have a functional fetch-url function

  • Loading branch information...
1 parent 97e3724 commit f4718f5fe207ae352fbc3d041e7b5d6a80b8eb48 @rippinrobr committed Oct 29, 2011
Showing with 6 additions and 5 deletions.
  1. +1 −1 hugoclr.clj
  2. +5 −4 hugoclr/parser.clj
View
2 hugoclr.clj
@@ -7,4 +7,4 @@
(defn -main [& args]
(println (str "base-url: " base-url))
- (hugo.parser/fetch-url base-url))
+ (println (hugoclr.parser/fetch-url base-url)))
View
9 hugoclr/parser.clj
@@ -1,10 +1,11 @@
(ns hugoclr.parser )
-;; (System.Reflection.Assembly/LoadWithPartialName "System.Windows.Forms")
-;; (import '(System.Windows.Forms MessageBox))
-
(defstruct work :winner :title :author)
(defstruct category :award :books :year)
(defn fetch-url [url]
- (println (str "Simulated call to " url)))
+ (println (str "retrieving " url "..."))
+ (let [res (.GetResponse (System.Net.WebRequest/Create url))
+ sr (new System.IO.StreamReader (.GetResponseStream res)) ]
+ (.ReadToEnd sr)))
+

0 comments on commit f4718f5

Please sign in to comment.
Something went wrong with that request. Please try again.