Streaming API for github in Racket
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.1 KiB

#lang racket
(require net/url)
(require json)
(require net/head)
(require srfi/41)
(define (get-next link)
(let* ([splitted (string-split link ";")]
[url (substring (car splitted)
(sub1 (string-length (car splitted))))]
[query (make-hash
(string->url url)))])
(hash-ref query 'since 1))))
(define (get-project-names since)
(define resp
(define headers
(purify-port resp))))
(hash-ref headers "Status" "")
"403 Forbidden")
(compose not (curry equal? 'null))
(lambda (p)
(hash-ref p 'description))
(read-json resp))))
(get-next (hash-ref headers "Link")))))]))
(get-project-names 1))