aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanh Vuong <thanhvg@gmail.com>2019-08-17 16:16:42 -0600
committerThanh Vuong <thanhvg@gmail.com>2019-08-17 16:16:42 -0600
commit8ea1ee23488db42092ae7f7b320a7301f4f4d5e1 (patch)
tree43485fe6d39f4489490377802522a6de2b906d17
parentd424b119f82bd21d7bf079063f165c8752c052cd (diff)
wip
-rw-r--r--hnreader.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/hnreader.el b/hnreader.el
index 26d23e7..4863402 100644
--- a/hnreader.el
+++ b/hnreader.el
@@ -8,10 +8,16 @@
(defvar hn--buffer "*HN*"
"Buffer for HN pages.")
+(defvar hn--comment-buffer "*HNComments*")
+
(defun hnreader--get-hn-buffer ()
"Get hn buffer."
(get-buffer-create hn--buffer))
+(defun hnreader--get-hn-comment-buffer ()
+ "Get hn commnet buffer."
+ (get-buffer-create hn--comment-buffer))
+
(defun hnreader--promise-dom (url)
"Promise (url . dom) from URL with curl."
(promise-new
@@ -46,7 +52,8 @@
;; points
(dom-text (dom-by-class subtext "^score$"))
;; comments
- (dom-text (last (dom-children subtext)))))
+ (dom-text (last (dom-by-tag subtext 'a)))))
+ ;; (setq thanh subtext)
;; link
(insert (dom-attr (dom-by-class thing "^storylink$") 'href) "\n" )
;; comment link