Skip to content

Instantly share code, notes, and snippets.

@cgrand
Created March 2, 2010 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save cgrand/319457 to your computer and use it in GitHub Desktop.
Save cgrand/319457 to your computer and use it in GitHub Desktop.
(-> "http://clojure-log.n01se.net/" java.net.URL. html-resource
(select {[:#main [:p (has [:b])]] [:#main [:p (right (has [:b]))]]})
(let-select [[nick] [:b]
says [:p :> (but-node #{whitespace :b [:a first-of-type]})]]
[(text nick) (apply str (texts says))]))
(comment Sample output
(["bradbeveridge: " "is Java's ZipInputStream really slow, or am I using it wrong?\n clojurebot: pastebin?\n"]
["clojurebot: " "excusez-moi\n"]
["bradbeveridge: " "http://clojure.pastebin.com/zR9di5K0"]
["zaphar_ps: " "bradbeveridge: I've never tried to benchmark it so I don't know\n"]
["bradbeveridge: " "ok, I was using it wrong\n I thought getNextEntry would throw\n it returns null, so I would have been sitting in an infinite loop for a while ;)\n it has native like perf\n"]
["zaphar_ps: " "heh\nAnyone else get the error \"Wrong number of arguments to task uberjar\" when running \"lein.bat uberjar\" in Windows?\n"]
["spariev: " "scottj: yep, I got this too, lein 1.1.0 seems to fix the problem - http://groups.google.com/group/leiningen/browse_thread/thread/a43ded3d659da915#"]
["scottj: " "spariev: thanks\n"]
["LauJensen: " "Morning crew\n"]
["TheBusby: " "evening\n"]
["spariev: " "Morning\nIsn't there an \"if\" in Clojure?\n"]
["bsteuber: " ",(doc if)\n"]
["clojurebot: " "Excuse me?\nThere is cond, if-not, if-let, but no if?\n"]
["bsteuber: " "there is\n at least it was there yesterday :)\n"]
["TheBusby: " ",(doc if)\n"]
["clojurebot: " "Huh?\n"]
["TheBusby: " "Please see http://clojure.org/special_forms#if"]
["bsteuber: " ",(if 5 :true :false)\n"]
["clojurebot: " ":true\n"]
["danlei: " "it's a special form\n"]
["ordnungswidrig: " "I think more idiomatic when, however\n"]
["esj: " "wotcha\nordnungswidrig: huh ?\n"]
["ordnungswidrig: " "LauJensen: hmm, I think I meant: \"I think more ideomatic than 'if' is when\"\n"]
["LauJensen: " "I dont think they vary in levels of idiomacy, but if is for 2 bodies, when is for 1, different uses\n"]
["esj: " "idiomacy, nice word.\n"]
["ordnungswidrig: " "LauJensen: you're right.\nhi there, could anyone help me with swank-clojure?\n i want to use it without the swank-clojure.jar\n bu i cannot configure my classpath so that it will find the (not compiled) source checkout\n"]
["AWizzArd: " "Moin guys\n"]
["a_strange_guy: " "moin moin\n"]
["AWizzArd: " "You want to use the code files directly, but not the compiled .jar file.\n"]
["a_strange_guy: " "correct\nAnd does the path of those source files show up in your (System/getProperty \"java.class.path\") ?\n"]
["a_strange_guy: " "I tried (S/gP \"j.c.p\")\n but no, the won't show up\n only .jar's\n"]
["AWizzArd: " "Then the CP needs to be set correctly.\n For some reason the \"/path/to/swank-clojure/\" thing was not added.\n"]
["a_strange_guy: " "swank-clojure-classpath = (append '(\"/opt/swank-clojure/src\") (swank-clojure-default-classpath))\n but when inferior lisp starts\n there are only jars on the CP\n"]
["AWizzArd: " "Then the append did not work as expected.\n"]
["a_strange_guy: " "append works as expected\n swank-clojure-classpath must be a list of strings\n"]
["AWizzArd: " "in my (custom-set-variables ...) I have: '(swank-clojure-extra-classpaths '(\"/hg/clj/\" \"/hg/clj/config/\" \"/hg/lib/clj/swank-clojure/\" \"/hg/lib/clj/clojure-contrib/clojure-contrib.jar\" ...))\n"]
["a_strange_guy: " "same here\n"]
["* " "a_strange_guy is reading swank-clojure.el\n"]
["a_strange_guy: " "it seems to work now\n"]
["AWizzArd: " "grats :)\n"]
["a_strange_guy: " "looks like swank-clojure.el got scared ^^\n"])
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment