Skip to content

Instantly share code, notes, and snippets.

@drewr
drewr / Main.purs
Created March 6, 2017 20:41 — forked from leighman/Main.purs
A Tale of 3 Nightclubs
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, logShow)
import Data.Either (Either(..))
import Data.Foldable (elem, notElem)
import Data.Int (toNumber)
import Data.Traversable (traverse)
import Data.Validation.Semigroup (invalid)
2009/11/20 drewr becomes a father!
AssetAndLiability:Progeny:Son 2 Child
GodOnlyKnowsWhereSoulsComeFrom
(ns com.notifymd.zip
(:import [com.csvreader CsvReader]))
(defn slurp-csv
"Return a map where key equals (keyword \"37211\") and
value equals the rest of the row minus the zip code"
[filename]
(let [reader (doto (CsvReader. filename)
(.readHeaders))
headers (map #(keyword (.toLowerCase %))
(ns rets
(:import (org.apache.http.impl.client DefaultHttpClient)
(org.apache.http.client.methods HttpGet HttpPost)
(org.apache.http.auth UsernamePasswordCredentials)
(org.apache.http.util EntityUtils)))
(use '[clojure.contrib.str-utils])
(def base-url "http://rets.realtracs.net:6103")
(def login-path "/rets/login")