ソースを参照

comments

master
Victor Fors 2年前
コミット
ab7bd261e6
1個のファイルの変更4行の追加2行の削除
  1. +4
    -2
      parking.scm

+ 4
- 2
parking.scm ファイルの表示

@@ -6,6 +6,7 @@
(import srfi-1) (import srfi-1)
(import (chicken io)) (import (chicken io))
(import srfi-13) (import srfi-13)
(import srfi-14)


(define (curry fn a) (define (curry fn a)
(lambda (b) (lambda (b)
@@ -64,7 +65,8 @@


;;; Given a list of either symbols or strings and an association list: ;;; 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 ;;; 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) (define (format-assoc statement ln)
(apply string-append (apply string-append
(map (curry2 upon symbol? (compose ->string (curry (flip value) ln))) statement))) (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 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 ;;; The Linköping municipal open data API key generator portal is located at http://opendata.linkoping.se
(define parking-key (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. ;;; 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: ;;; It should be noted that this API is both glitchy and bugged. Two bugs have been noted:


読み込み中…
キャンセル
保存