From f5f5b6b4929a4f907e65bc3d762f55877a7c5012 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Thu, 6 Jun 2019 19:42:09 -0400 Subject: hn/g: Add athing:id. hn/g (athing:id): New function. --- hn/g | 6 ++++++ 1 file changed, 6 insertions(+) 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))) + -- cgit v1.2.3