有哪位同学熟悉 url 和 json, 麻烦帮忙优化一下下面这段代码,我不太熟悉 url 库,写出来的代码感觉有点 low.
(defun pyim-cloudpinyin-baidu (string)
"使用 baidu 搜索 STRING, 获取词条列表。"
(with-current-buffer (url-retrieve-synchronously
(format "https://olime.baidu.com/py?py=%s" string)
t nil 1)
(goto-char (point-min))
(search-forward "\n\n" nil t)
(delete-region (point-min) (point))
(let ((data (json-parse-buffer)))
(list (elt (elt (elt (gethash "0" data) 0) 0) 0)))))