Created
October 15, 2013 04:02
-
-
Save robertjlooby/6986296 to your computer and use it in GitHub Desktop.
Using the metra Rail-Time Tracker API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns metra | |
(:require [cheshire.core :refer [generate-string parse-string] | |
[clj-http.client :as http])) | |
(defn get-trains [] | |
(let [timestamp (str "/Date(" (.getTime (java.util.Date.)) "-0000)/") | |
body {:stationRequest {:Corridor "MD-N", :Destination "LIBERTYVIL", :Origin "CUS", :timestamp timestamp}} | |
response (http/post "http://12.205.200.243/AJAXTrainTracker.svc/GetAcquityTrainData" {:body (generate-string body) :content-type :json}) | |
resp-body (parse-string ((parse-string (response :body) true) :d) true)] | |
resp-body)) |
Author
robertjlooby
commented
Oct 16, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment