]> git.donarmstrong.com Git - org-ref.git/blobdiff - doi-utils.el
fix typo in wiley-pdf
[org-ref.git] / doi-utils.el
index 74c0045c7e94ee4eb240dde49c27551dc56c666b..385785af1e52d1c2092ff3e76abb007c6a55eb18 100644 (file)
@@ -1,9 +1,11 @@
-;;; 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
 
 ;; 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
 
 ;; 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
@@ -30,8 +32,6 @@
 ;; - 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.
 
 ;; - 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:
 (require 'json)
 
 ;;; Code:
 
 
 (defun doi-utils-get-wiley-pdf-url (redirect-url)
 
 
 (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)
   (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)
                  (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*)
 
   (while *doi-utils-waiting* (sleep-for 0.1))
   *doi-utils-pdf-url*)