diff options
author | rsiddharth <s@ricketyspace.net> | 2019-06-07 19:24:02 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2019-06-07 19:24:02 -0400 |
commit | 444483355aca32d6ca4491224f14d3af553fcd0e (patch) | |
tree | d0ee7b78419b8446129e2abff2ab3a48b7384d03 | |
parent | 070b053ff4cea1fc7efb3249a2bddf1bf64bd185 (diff) |
hn/g: Add docstrings.
-rwxr-xr-x | hn/g | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) |