[racket] Github API in Racket

From: Tony Garnock-Jones (tonyg at ccs.neu.edu)
Date: Wed Dec 17 12:37:47 EST 2014

Hi Animesh,

I have a fork of Sam's code that adds support for a few more API
features: https://github.com/tonyg/octokit.rkt

Like Sam, I've only added support for those specific API features I
needed at the time.


On 12/12/2014 08:09 PM, Sam Tobin-Hochstadt wrote:
> Hi Animesh,
> You're on the right track in using the API for getting data from
> github. I've written a wrapper already that covers some parts of the
> github api, but far from all of it. You can see the code here:
> https://github.com/samth/github.rkt and you can install it with `raco
> pkg install github`. Like I said, there's lots missing there, and so
> I'd love help in filling out more of the API -- I've really only
> written the parts I've needed in the past.
> Sam
> On Fri, Dec 12, 2014 at 8:03 PM, Animesh Pandey
> <animeshpandey.etno at gmail.com> wrote:
>> 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!
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.