Skip to content

Commit

Permalink
fixed 500 when there are some BS in the json
Browse files Browse the repository at this point in the history
  • Loading branch information
fterrier committed Feb 14, 2015
1 parent e4f73f1 commit b6e6c2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion newrelic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ common: &default_settings
# See https://docs.newrelic.com/docs/java/real-user-monitoring-in-java#manual_instrumentation
# for instructions to add these manually to your pages.
# Set this attribute to false to turn off this behavior.
auto_instrument: true
auto_instrument: false

class_transformer:
# This instrumentation reports the name of the user principal returned from
Expand Down
7 changes: 4 additions & 3 deletions src/clj/tramboard_clj/core/zvv.clj
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@
; TODO tests (=> capture some data from zvv api)
(defn transform-station-response [response-body]
;(spit "fixtures/zvv_responses/new.txt" response-body)
(let [unparsed (clojure.string/replace-first response-body "journeysObj = " "")
data (json/parse-string unparsed)
journeys (data "journey")]
(let [unparsed (clojure.string/replace-first response-body "journeysObj = " "")
replace-bs (clojure.string/replace (clojure.string/replace unparsed "{label:" "{\"label\":") ",url:" ",\"url\":")
data (json/parse-string replace-bs)
journeys (data "journey")]
{:meta {:station_id (data "stationEvaId")
:station_name (data "stationName")}
:departures (map zvv-departure journeys)}))
Expand Down

0 comments on commit b6e6c2f

Please sign in to comment.