Setting up the project
Before we get started, let's set up the project. I've done this using Leiningen 2 (http://leiningen.org/) and Stuart Sierra's reloaded project template (https://github.com/stuartsierra/reloaded). I named the project social-so
by running the following code:
$ lein new reloaded social-so
Of course, we'll need more dependencies. The following is the project.clj
file for this chapter:
(defproject social-so "0.1.0-SNAPSHOT" :dependencies [[org.clojure/clojure "1.5.1"] [org.clojure/data.xml "0.0.7"] [org.codehaus.jsr166-mirror/jsr166y "1.7.0"] [org.clojure/data.json "0.2.4"] [cc.mallet/mallet "2.0.7"] [org.jsoup/jsoup "1.7.3"]] :profiles {:dev {:dependencies [[org.clojure/tools.namespace "0.2.4"]] :source-paths ["dev"]}} :jvm-opts ["-Xmx2048m"])
The highlights here are that we'll use org.clojure/data.xml
to read XML files, org.clojure/data.json
to...