diff --git a/parking.scm b/parking.scm index 6130b2f..b3e1037 100644 --- a/parking.scm +++ b/parking.scm @@ -6,6 +6,7 @@ (import srfi-1) (import (chicken io)) (import srfi-13) +(import srfi-14) (define (curry fn a) (lambda (b) @@ -64,7 +65,8 @@ ;;; Given a list of either symbols or strings and an association list: ;;; look up every symbol from left to right in the association list and replace it with the value found -;;; then concatenate the resulting list of strings +;;; then concatenate the resulting list of strings. +;;; Inspired by Python 3's dictionary formatting string syntax. (define (format-assoc statement ln) (apply string-append (map (curry2 upon symbol? (compose ->string (curry (flip value) ln))) statement))) @@ -76,7 +78,7 @@ ;;; The API key is an alphanumeric string of length 32 ;;; The Linköping municipal open data API key generator portal is located at http://opendata.linkoping.se (define parking-key - (with-input-from-file "key-parking" read-line)) + (string-delete char-set:whitespace (with-input-from-file "key-parking" read-line))) ;;; Get a list of parking lots with various metadata from the municipal servers. ;;; It should be noted that this API is both glitchy and bugged. Two bugs have been noted: