我正在将erc-tweet移植到rcirc并成功移植了抓取逻辑。
(require 'request)
(request "https://twitter.com/spacemanaki/status/392097918812839937"
:parser 'buffer-string
:success (function*
(lambda (&key data &allow-other-keys)
(save-excursion
(with-current-buffer (get-buffer-create "*request demo*")
(erase-buffer)
(insert data)
(goto-char (point-min))
(kill-region
(point)
(progn (search-forward
"<p class=\"js-tweet-text tweet-text\">")
(point)))
(kill-region
(progn (search-forward "</p>")
(search-backward "</p>")
(point))
(point-max))
(kill-region (point-min) (point-max))))
(yank))))
关于何时开始替换的正则表达式可以从erc-tweet "https?://twitter.com/.+/status/[0-9]+"
重用。问题是现在我需要在哪里挂钩函数,我在rcirc中找不到类似于erc-insert-modify-hook的东西。
答案 0 :(得分:1)
只要我能看到,你就有了
rcirc-mode-hook,
rcirc-activity-hooks
rcirc-receive-message-hooks
rcirc-print-hooks
rcirc-sentinel-hooks
rcirc-authenticate-hook
rcirc-update-activit-string-hook
使用M-x“C-h v”进行检查。