wisp

get interweb fluff
Log | Files | Refs

commit ca1f7b80f740c4d43c291627d9b80161a1b0d7bd
parent 49f674933eb63fda89a262a4678f07f854cb4fc7
Author: rsiddharth <s@ricketyspace.net>
Date:   Tue, 18 Jun 2019 19:47:44 -0400

hn/g: Add slug.

* hn/g (slug): New function.

Diffstat:
hn/g | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/hn/g b/hn/g @@ -7,9 +7,11 @@ #lang racket/base +(require racket/date) (require racket/list) (require racket/port) (require racket/format) +(require racket/string) (require net/http-client) (require openssl) @@ -24,6 +26,12 @@ (define (fmt n w) (~a n #:width w #:align 'right #:pad-string "0")) +(define (slug) + (let* ((d (current-date))) + (string-join `(,(fmt (date-year d) 4) + ,(fmt (date-month d) 2) + ,(fmt (date-day d) 2)) ""))) + (define (fp) "Fetch HN Front Page." (let ((hc (http-conn-open HOST #:ssl? (ssl-make-client-context 'secure)