Created
January 7, 2014 22:36
-
-
Save m039/8308224 to your computer and use it in GitHub Desktop.
Get username from http://graph.facebook.com/<id>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Playing with racket | |
(require net/url) | |
(require json) | |
(require rnrs/io/ports-6) | |
(define link "http://graph.facebook.com/") | |
(define (get-username id) | |
(let ((ht (call-with-port (get-pure-port (string->url (string-append link id))) | |
(lambda (p) | |
(read-json p))))) | |
(hash-ref ht 'username))) | |
(get-username "4") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment