Skip to content

Instantly share code, notes, and snippets.

@Licenser
Forked from devn/irc-parser.clj
Created March 16, 2010 15:29
Show Gist options
  • Save Licenser/334097 to your computer and use it in GitHub Desktop.
Save Licenser/334097 to your computer and use it in GitHub Desktop.
(ns irc-parser.core
(:use clojure.contrib.duck-streams
clojure.contrib.str-utils
clojure.contrib.seq-utils))
(def dates (file-seq (java.io.File. "./clojure")))
(defn parse-irc-log
[logfile]
(line-seq (reader logfile)))
(def parsed (map parse-irc-log (rest dates)))
(defn find-lines
[#^String text logs]
(flatten (map
(fn [log] (filter (fn [#^String line] (< 0 (.indexOf line text))) log))
logs)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment