From 5486675ad8bab695584d3fc7aacf0b89ccebf117 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 13 Apr 2010 01:43:10 -0700 Subject: [PATCH] bit.ly: some old-school newfx --- extra/bit/ly/ly.factor | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extra/bit/ly/ly.factor b/extra/bit/ly/ly.factor index 1dcdf97dff..0220fba264 100644 --- a/extra/bit/ly/ly.factor +++ b/extra/bit/ly/ly.factor @@ -7,6 +7,8 @@ SYMBOLS: login api-key ; url login get "login" set-query-param @@ -17,13 +19,13 @@ SYMBOLS: login api-key ; ERROR: bad-response json status ; : check-response ( json -- json ) - dup "status_code" swap at 200 = [ - dup "status_txt" swap at + dup "status_code" of 200 = [ + dup "status_txt" of bad-response ] unless ; : parse-response ( response data -- short-url ) - nip json> check-response "data" swap at "url" swap at ; + nip json> check-response "data" of "url" of ; PRIVATE>