summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xhn/g6
1 files changed, 6 insertions, 0 deletions
diff --git a/hn/g b/hn/g
index 8432cad..ae80410 100755
--- a/hn/g
+++ b/hn/g
@@ -14,6 +14,7 @@
(require openssl)
(require html-parsing)
+(require sxml)
(require sxml/sxpath)
@@ -34,3 +35,8 @@
(s (sxpath "//tr[@class=\"athing\"]")))
(take (s x) 20)))
+(define (athing:id a)
+ (let ((id (sxml:attr a 'id)))
+ (if (empty? id) (error "athing:id: Unable to get id")
+ id)))
+