|
@@ -24,20 +24,22 @@
|
|
|
|
|
|
|
|
(defun get-brent ()
|
|
(defun get-brent ()
|
|
|
(handler-case
|
|
(handler-case
|
|
|
- (read-from-string
|
|
|
|
|
- (aget "last" (first (aget "quotes"
|
|
|
|
|
- (yason:parse
|
|
|
|
|
- (flexi-streams:octets-to-string
|
|
|
|
|
- (drakma:http-request +brent-url+
|
|
|
|
|
- :force-binary t
|
|
|
|
|
- :decode-content t)
|
|
|
|
|
- :external-format :utf-8)
|
|
|
|
|
- :object-as :alist)))))
|
|
|
|
|
|
|
+ (let ((last (read-from-string
|
|
|
|
|
+ (aget "last" (first (aget "quotes"
|
|
|
|
|
+ (yason:parse
|
|
|
|
|
+ (flexi-streams:octets-to-string
|
|
|
|
|
+ (drakma:http-request +brent-url+
|
|
|
|
|
+ :force-binary t
|
|
|
|
|
+ :decode-content t)
|
|
|
|
|
+ :external-format :utf-8)
|
|
|
|
|
+ :object-as :alist)))))))
|
|
|
|
|
+ (when (numberp last)
|
|
|
|
|
+ last))
|
|
|
(error (e) (log:error e))))
|
|
(error (e) (log:error e))))
|
|
|
|
|
|
|
|
(defun get-serie (series name)
|
|
(defun get-serie (series name)
|
|
|
(loop for (time . rates) in series
|
|
(loop for (time . rates) in series
|
|
|
- when (aget name rates)
|
|
|
|
|
|
|
+ when (numberp (aget name rates))
|
|
|
collect (list time (aget name rates))))
|
|
collect (list time (aget name rates))))
|
|
|
|
|
|
|
|
(defun make-chart (series &key (usd t) (eur t) (gbp t) (brent t))
|
|
(defun make-chart (series &key (usd t) (eur t) (gbp t) (brent t))
|