-;;; doi-utils.el --- DOI utilities for making bibtex entries and downloading PDFs -*- lexical-binding: t; -*-
+;;; doi-utils.el --- DOI utilities for making bibtex entries
;; Copyright (C) 2015 John Kitchin
;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
;; Keywords: convenience
+;; Version: 0.1
+;; Package-Requires: ((org-ref))
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; - doi-utils-add-bibtex-entry-from-region to add an entry from a highlighed doi to your default bibliography.
;; - doi-utils-update-bibtex-entry-from-doi with cursor in an entry to update its fields.
-;; Package-Requires: ((org-ref))
-
(require 'json)
;;; Code:
(defun doi-utils-get-wiley-pdf-url (redirect-url)
- "wileyscience direct hides the pdf url in html. we get it out here"
+ "Wileyscience direct hides the pdf url in html.
+We get it out here by parsing the html."
(setq *doi-utils-waiting* t)
(url-retrieve redirect-url
(lambda (status)
- (beginning-of-buffer)
+ (goto-char (point-min))
(re-search-forward "<iframe id=\"pdfDocument\" src=\"\\([^\"]*\\)\"" nil)
(setq *doi-utils-pdf-url* (match-string 1)
- ,*doi-utils-waiting* nil)))
+ *doi-utils-waiting* nil)))
(while *doi-utils-waiting* (sleep-for 0.1))
*doi-utils-pdf-url*)