wisp

get interweb fluff
Log | Files | Refs

commit 444483355aca32d6ca4491224f14d3af553fcd0e
parent 070b053ff4cea1fc7efb3249a2bddf1bf64bd185
Author: rsiddharth <s@ricketyspace.net>
Date:   Fri,  7 Jun 2019 19:24:02 -0400

hn/g: Add docstrings.

Diffstat:
hn/g | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hn/g b/hn/g @@ -30,17 +30,19 @@ (port->string port))) (define (athings) - "Get 20 athings from HN front page." + "Get top 20 athings from HN front page." (let ((x (html->xexp (fp))) (s (sxpath "//tr[@class=\"athing\"]"))) (take (s x) 20))) (define (athing:id a) + "Return athing id" (let ((id (sxml:attr a 'id))) (if (empty? id) (error "athing:id: Unable to get id") id))) (define (athing:link a) + "Return athing link (HREF DESC)" (let* ((s (sxpath "//a[@class=\"storylink\"]")) (l (s a))) (list (sxml:attr (car l) 'href)