Skip to content

Commit

Permalink
add open in openalex action
Browse files Browse the repository at this point in the history
  • Loading branch information
jkitchin committed Jan 17, 2024
1 parent fe6463c commit 0ea5672
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions openalex.el
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,21 @@ With prefix arg ASCENDING sort from low to high."
(interactive)
(oa--cited-by-works (concat "doi:" (org-ref-get-doi-at-point))))

(defun oa-open ()
"Open the cite at point in OpenAlex."
(interactive)
(let* ((url (concat
"https://api.openalex.org/works/https://doi.org/"
(org-ref-get-doi-at-point)))
(req (request url :sync t :parser 'oa--response-parser))
(data (request-response-data req)))
(browse-url (plist-get data :id))))


(defhydra+ org-ref-citation-hydra ()
"Add open from action to `org-ref-citation-hydra'."
("xa" oa-open "Open in OpenAlex" :column "OpenAlex"))


(defhydra+ org-ref-citation-hydra ()
"Add related documents action to `org-ref-citation-hydra'."
Expand Down

0 comments on commit 0ea5672

Please sign in to comment.