Welcome to the CHICKEN Scheme pasting service
define-method to access the mtgox API pasted by alaricsp on Wed Apr 3 17:36:56 2013
#;5> (define-method (btc-gbp) > "https://data.mtgox.com/api/2/BTCGBP/money/ticker" > #f > read-json) #;6> (btc-gbp) ((result . "success") (data (high (value . "99.30100") (value_int . "9930100") (display . "£99.30") (display_short . "£99.30") (currency . "GBP")) (low (value . "70.61000") (value_int . "7061000") (display . "£70.61") (display_short . "£70.61") (currency . "GBP")) (avg (value . "85.71182") (value_int . "8571182") (display . "£85.71") (display_short . "£85.71") (currency . "GBP")) (vwap (value . "86.62922") (value_int . "8662922") (display . "£86.63") (display_short . "£86.63") (currency . "GBP")) (vol (value . "3559.11016768") (value_int . "355911016768") (display . "3,559.11 BTC") (display_short . "3,559.11 BTC") (currency . "BTC")) (last_local (value . "94.99491") (value_int . "9499491") (display . "£94.99") (display_short . "£94.99") (currency . "GBP")) (last_orig (value . "141.32001") (value_int . "14132001") (display . "$141.32") (display_short . "$141.32") (currency . "USD")) (last_all (value . "93.21177") (value_int . "9321177") (display . "£93.21") (display_short . "£93.21") (currency . "GBP")) (last (value . "94.99491") (value_int . "9499491") (display . "£94.99") (display_short . "£94.99") (currency . "GBP")) (buy (value . "94.99491") (value_int . "9499491") (display . "£94.99") (display_short . "£94.99") (currency . "GBP")) (sell (value . "95.00000") (value_int . "9500000") (display . "£95.00") (display_short . "£95.00") (currency . "GBP")) (item . "BTC") (now . "1365000314322025"))) (#<URI-common: scheme=https port=#f host="data.mtgox.com" path=(/ "api" "2" "BTCGBP" "money" "ticker") query=() fragment=#f> #<response>) ; 2 values
Parameterised the currency added by alaricsp on Wed Apr 3 17:42:58 2013
(define-method (btc-ticker* currency money ticker) "https://data.mtgox.com/api/2" #f read-json) (define btc-ticker (cut btc-ticker* <> "money" "ticker"))