wisp

get interweb fluff
Log | Files | Refs

commit f5f5b6b4929a4f907e65bc3d762f55877a7c5012
parent 68ec686a93b5e461a1bcf14b00c6ecdda4af87d1
Author: rsiddharth <s@ricketyspace.net>
Date:   Thu,  6 Jun 2019 19:42:09 -0400

hn/g: Add athing:id.

hn/g (athing:id): New function.

Diffstat:
hn/g | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git 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))) +