summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-06-06 19:42:57 -0400
committerrsiddharth <s@ricketyspace.net>2019-06-06 19:42:57 -0400
commit152d5a5382b2d9418506809f59bb568941194bb3 (patch)
tree223a13a3e9ecfc03febdc5513f326b7b1ebe8736
parentf5f5b6b4929a4f907e65bc3d762f55877a7c5012 (diff)
hn/g: Add athing:link.
* hn/g (athing:link): New function.
-rwxr-xr-xhn/g6
1 files changed, 6 insertions, 0 deletions
diff --git a/hn/g b/hn/g
index ae80410..e8c7640 100755
--- a/hn/g
+++ b/hn/g
@@ -40,3 +40,9 @@
(if (empty? id) (error "athing:id: Unable to get id")
id)))
+(define (athing:link a)
+ (let* ((s (sxpath "//a[@class=\"storylink\"]"))
+ (l (s a)))
+ (list (sxml:attr (car l) 'href)
+ (sxml:text l))))
+