summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-06-07 19:24:02 -0400
committerrsiddharth <s@ricketyspace.net>2019-06-07 19:24:02 -0400
commit444483355aca32d6ca4491224f14d3af553fcd0e (patch)
treed0ee7b78419b8446129e2abff2ab3a48b7384d03
parent070b053ff4cea1fc7efb3249a2bddf1bf64bd185 (diff)
hn/g: Add docstrings.
-rwxr-xr-xhn/g4
1 files changed, 3 insertions, 1 deletions
diff --git a/hn/g b/hn/g
index 6d2278b..3f3d133 100755
--- 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)