diff options
author | rsiddharth <s@ricketyspace.net> | 2019-06-06 19:42:09 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2019-06-06 19:42:09 -0400 |
commit | f5f5b6b4929a4f907e65bc3d762f55877a7c5012 (patch) | |
tree | 049ab002ea734a81610961dd6d5e2acdc4e458b0 | |
parent | 68ec686a93b5e461a1bcf14b00c6ecdda4af87d1 (diff) |
hn/g: Add athing:id.
hn/g (athing:id): New function.
-rwxr-xr-x | hn/g | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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))) + |