Using the metra Rail-Time Tracker API
(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)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.