[racket] Github API in Racket

From: Animesh Pandey (animeshpandey.etno at gmail.com)
Date: Fri Dec 12 20:03:13 EST 2014

Hi,
I want to write a wrapper for the GitHub API. I have never actually written
a wrapper before so I wanted to know if there is any specific design
methodology that we have to follow for writing a wrapper.
The Github API as I see returns a JSON object as the response after we send
a request to it. I tried writing a script for reading that response.

#lang racket

(require net/url)
(require json)

(define input
  (get-pure-port
   (string->url "https://api.github.com/users/some_username")))
(define response (port->string input))
(close-input-port input)

(define x (string->jsexpr response))
(for (((key val) (in-hash x)))
  (printf "~a = ~a~%" key val))

Please tell me this method is correct or not? Is this how we start writing
a wrapper?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20141212/c3471811/attachment.html>

Posted on the users mailing list.