<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <atom:link href="http://kitchingroup.cheme.cmu.edu/blog/feed/index.xml" rel="self" type="application/rss+xml" />
    <title>The Kitchin Research Group</title>
    <link>https://kitchingroup.cheme.cmu.edu/blog</link>
    <description>Chemical Engineering at Carnegie Mellon University</description>
    <pubDate>Sat, 01 Nov 2025 13:47:46 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    
    <item>
      <title>A python version of the s-exp bibtex entry</title>
      <link>https://kitchingroup.cheme.cmu.edu/blog/2015/06/11/A-python-version-of-the-s-exp-bibtex-entry</link>
      <pubDate>Thu, 11 Jun 2015 10:02:33 EDT</pubDate>
      <category><![CDATA[bibtex]]></category>
      <category><![CDATA[ref]]></category>
      <category><![CDATA[python]]></category>
      <guid isPermaLink="false">wiSIiOPCsb2TZCwk1GsyFwgTiFw=</guid>
      <description>A python version of the s-exp bibtex entry</description>
      <content:encoded><![CDATA[



&lt;p&gt;
In this &lt;a href="http://kitchingroup.cheme.cmu.edu/blog/2015/06/10/A-sexp-version-of-a-bibtex-entry/"&gt;post&lt;/a&gt; we explored representing a bibtex entry in lisp s-exp notation, and showed interesting things that enables. Here, I explore something similar in Python. The s-exp notation in Python is really more like tuples. It looks almost identical, except we need a lot of commas for the Python syntax. One significant difference in Python is we need to define the functions in advance because otherwise the function symbols are undefined. Similar to lisp, we can define the field functions at run-time in a loop. We have to use an eval statement, which some Pythonistas find distasteful, but it is not that different to me than what we did in lisp.
&lt;/p&gt;

&lt;p&gt;
The syntax for "executing" the data structure is quite different than in lisp, because this data is &lt;i&gt;not&lt;/i&gt; code in Python. Instead, we have to deconstruct the data, knowing that the function is the first object, and it takes the remaining arguments in the tuple.
&lt;/p&gt;

&lt;p&gt;
Here is the proof of concept:
&lt;/p&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-python"&gt;&lt;span style="color: #0000FF;"&gt;def&lt;/span&gt; &lt;span style="color: #006699;"&gt;article&lt;/span&gt;(bibtex_key, *args):
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #008000;"&gt;"Return the bibtex formatted entry"&lt;/span&gt;
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #0000FF;"&gt;return&lt;/span&gt; &lt;span style="color: #008000;"&gt;',\n'&lt;/span&gt;.join([&lt;span style="color: #008000;"&gt;'@article{{{0}}}'&lt;/span&gt;.&lt;span style="color: #006FE0;"&gt;format&lt;/span&gt;(bibtex_key)] +[arg[0](arg[1]) &lt;span style="color: #0000FF;"&gt;for&lt;/span&gt; arg &lt;span style="color: #0000FF;"&gt;in&lt;/span&gt; args[0]] + [&lt;span style="color: #008000;"&gt;'}'&lt;/span&gt;])

&lt;span style="color: #BA36A5;"&gt;fields&lt;/span&gt; = (&lt;span style="color: #008000;"&gt;"author"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"title"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"journal"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"pages"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"number"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"doi"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"url"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"eprint"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"year"&lt;/span&gt;)

&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt; f &lt;span style="color: #0000FF;"&gt;in&lt;/span&gt; fields:
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #006FE0;"&gt;locals&lt;/span&gt;()[f] = &lt;span style="color: #006FE0;"&gt;eval&lt;/span&gt; (&lt;span style="color: #008000;"&gt;'lambda x: "  {0} = {{{1}}}".format("'&lt;/span&gt; + f + &lt;span style="color: #008000;"&gt;'", x)'&lt;/span&gt;)

&lt;span style="color: #BA36A5;"&gt;entry&lt;/span&gt; = (article, &lt;span style="color: #008000;"&gt;"hallenbeck-2013-effec-o2"&lt;/span&gt;,
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;    (author, &lt;span style="color: #008000;"&gt;"Hallenbeck, Alexander P. and Kitchin, John R."&lt;/span&gt;),
         (title, &lt;span style="color: #008000;"&gt;"Effects of \ce{O_2} and \ce{SO_2} on the capture capacity of a primary-amine based polymeric \ce{CO_2} sorbent"&lt;/span&gt;),
         (journal, &lt;span style="color: #008000;"&gt;"Industrial \&amp;amp; Engineering Chemistry Research"&lt;/span&gt;),
         (pages, &lt;span style="color: #008000;"&gt;"10788-10794"&lt;/span&gt;),
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;    (year, 2013),
         (number, 31),
         (doi, &lt;span style="color: #008000;"&gt;"10.1021/ie400582a"&lt;/span&gt;),
         (url, &lt;span style="color: #008000;"&gt;"http://pubs.acs.org/doi/abs/10.1021/ie400582a"&lt;/span&gt;),
         (eprint, &lt;span style="color: #008000;"&gt;"http://pubs.acs.org/doi/pdf/10.1021/ie400582a"&lt;/span&gt;))


&lt;span style="color: #0000FF;"&gt;print&lt;/span&gt; entry[0](entry[1], entry[2:])
&lt;/pre&gt;
&lt;/div&gt;

&lt;pre class="example"&gt;
@article{hallenbeck-2013-effec-o2},
  author = {Hallenbeck, Alexander P. and Kitchin, John R.},
  title = {Effects of \ce{O_2} and \ce{SO_2} on the capture capacity of a primary-amine based polymeric \ce{CO_2} sorbent},
  journal = {Industrial \&amp;amp; Engineering Chemistry Research},
  pages = {10788-10794},
  year = {2013},
  number = {31},
  doi = {10.1021/ie400582a},
  url = {http://pubs.acs.org/doi/abs/10.1021/ie400582a},
  eprint = {http://pubs.acs.org/doi/pdf/10.1021/ie400582a},
}
&lt;/pre&gt;

&lt;p&gt;
We can still get specific fields out. Since we used a tuple here, it is not quite as nice as using a dictionary, but it is neither too bad, and it can be wrapped in a reasonably convenient function.
&lt;/p&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-python"&gt;&lt;span style="color: #0000FF;"&gt;def&lt;/span&gt; &lt;span style="color: #006699;"&gt;article&lt;/span&gt;(bibtex_key, *args):
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #008000;"&gt;"Return the bibtex formatted entry"&lt;/span&gt;
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #0000FF;"&gt;return&lt;/span&gt; &lt;span style="color: #008000;"&gt;',\n'&lt;/span&gt;.join([&lt;span style="color: #008000;"&gt;'@article{{{0}}}'&lt;/span&gt;.&lt;span style="color: #006FE0;"&gt;format&lt;/span&gt;(bibtex_key)] +[arg[0](arg[1]) &lt;span style="color: #0000FF;"&gt;for&lt;/span&gt; arg &lt;span style="color: #0000FF;"&gt;in&lt;/span&gt; args[0]] + [&lt;span style="color: #008000;"&gt;'}'&lt;/span&gt;])

&lt;span style="color: #BA36A5;"&gt;fields&lt;/span&gt; = (&lt;span style="color: #008000;"&gt;"author"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"title"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"journal"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"pages"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"number"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"doi"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"url"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"eprint"&lt;/span&gt;, &lt;span style="color: #008000;"&gt;"year"&lt;/span&gt;)

&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt; f &lt;span style="color: #0000FF;"&gt;in&lt;/span&gt; fields:
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #006FE0;"&gt;locals&lt;/span&gt;()[f] = &lt;span style="color: #006FE0;"&gt;eval&lt;/span&gt; (&lt;span style="color: #008000;"&gt;'lambda x: "  {0} = {{{1}}}".format("'&lt;/span&gt; + f + &lt;span style="color: #008000;"&gt;'", x)'&lt;/span&gt;)

&lt;span style="color: #BA36A5;"&gt;entry&lt;/span&gt; = (article, &lt;span style="color: #008000;"&gt;"hallenbeck-2013-effec-o2"&lt;/span&gt;,
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;    (author, &lt;span style="color: #008000;"&gt;"Hallenbeck, Alexander P. and Kitchin, John R."&lt;/span&gt;),
         (title, &lt;span style="color: #008000;"&gt;"Effects of \ce{O_2} and \ce{SO_2} on the capture capacity of a primary-amine based polymeric \ce{CO_2} sorbent"&lt;/span&gt;),
         (journal, &lt;span style="color: #008000;"&gt;"Industrial \&amp;amp; Engineering Chemistry Research"&lt;/span&gt;),
         (pages, &lt;span style="color: #008000;"&gt;"10788-10794"&lt;/span&gt;),
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;    (year, 2013),
         (number, 31),
         (doi, &lt;span style="color: #008000;"&gt;"10.1021/ie400582a"&lt;/span&gt;),
         (url, &lt;span style="color: #008000;"&gt;"http://pubs.acs.org/doi/abs/10.1021/ie400582a"&lt;/span&gt;),
         (eprint, &lt;span style="color: #008000;"&gt;"http://pubs.acs.org/doi/pdf/10.1021/ie400582a"&lt;/span&gt;))


&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt; field &lt;span style="color: #0000FF;"&gt;in&lt;/span&gt; entry[2:]:
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #0000FF;"&gt;if&lt;/span&gt; field[0] == author:
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #0000FF;"&gt;print&lt;/span&gt; field

&lt;span style="color: #0000FF;"&gt;def&lt;/span&gt; &lt;span style="color: #006699;"&gt;get_field&lt;/span&gt;(entry, field):
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #0000FF;"&gt;for&lt;/span&gt; element &lt;span style="color: #0000FF;"&gt;in&lt;/span&gt; entry[2:]:
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #0000FF;"&gt;if&lt;/span&gt; element[0] == field:
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #0000FF;"&gt;return&lt;/span&gt; element[1]
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #0000FF;"&gt;else&lt;/span&gt;:
&lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #9B9B9B; background-color: #EDEDED;"&gt; &lt;/span&gt;   &lt;span style="color: #0000FF;"&gt;return&lt;/span&gt; &lt;span style="color: #D0372D;"&gt;None&lt;/span&gt;

&lt;span style="color: #0000FF;"&gt;print&lt;/span&gt; get_field(entry, title)
&lt;span style="color: #0000FF;"&gt;print&lt;/span&gt; get_field(entry, &lt;span style="color: #008000;"&gt;"bad"&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;

&lt;pre class="example"&gt;
(&amp;lt;function &amp;lt;lambda&amp;gt; at 0x1005975f0&amp;gt;, 'Hallenbeck, Alexander P. and Kitchin, John R.')
Effects of \ce{O_2} and \ce{SO_2} on the capture capacity of a primary-amine based polymeric \ce{CO_2} sorbent
None
&lt;/pre&gt;

&lt;p&gt;
So, it seems Python can do some things like lisp in treating functions like first-class objects that can be used as functions, or keys. I still like the lisp s-exp better, but this is an interesting idea for Python too.
&lt;/p&gt;
&lt;p&gt;Copyright (C) 2015 by John Kitchin. See the &lt;a href="/copying.html"&gt;License&lt;/a&gt; for information about copying.&lt;p&gt;&lt;p&gt;&lt;a href="/org/2015/06/11/A-python-version-of-the-s-exp-bibtex-entry.org"&gt;org-mode source&lt;/a&gt;&lt;p&gt;&lt;p&gt;Org-mode version = 8.2.10&lt;/p&gt;]]></content:encoded>
    </item>
    <item>
      <title>Converting a DOI to other scientific identifiers in Pubmed</title>
      <link>https://kitchingroup.cheme.cmu.edu/blog/2015/06/09/Converting-a-DOI-to-other-scientific-identifiers-in-Pubmed</link>
      <pubDate>Tue, 09 Jun 2015 07:29:08 EDT</pubDate>
      <category><![CDATA[orgmode]]></category>
      <category><![CDATA[ref]]></category>
      <guid isPermaLink="false">Y9RJH7dnbEDT8iB-XiB8NBRsGLU=</guid>
      <description>Converting a DOI to other scientific identifiers in Pubmed</description>
      <content:encoded><![CDATA[



&lt;p&gt;
Sometimes it is useful to convert a DOI to another type of identifier. For example, in this &lt;a href="http://kitchingroup.cheme.cmu.edu/blog/2015/06/07/Getting-a-Scopus-EID-from-a-DOI/"&gt;post&lt;/a&gt; we converted a DOI to a Scopus EID, and in this &lt;a href="http://kitchingroup.cheme.cmu.edu/blog/2015/06/08/Getting-a-WOS-Accession-number-from-a-DOI/"&gt;one&lt;/a&gt; we got the WOS accession number from a DOI. Today, we consider how to get Pubmed identifiers. Pubmed provides an API for this purpose:
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.ncbi.nlm.nih.gov/pmc/tools/id-converter-api/"&gt;http://www.ncbi.nlm.nih.gov/pmc/tools/id-converter-api/&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
We will use the DOI tool. According to the documentation, we need to form a URL like this:
&lt;/p&gt;

&lt;p&gt;
DOI: &lt;a href="http://www.ncbi.nlm.nih.gov/pmc/utils/idconv/v1.0/?tool=my_tool&amp;email=my_email@example.com&amp;ids=10.1093/nar/gks1195"&gt;http://www.ncbi.nlm.nih.gov/pmc/utils/idconv/v1.0/?tool=my_tool&amp;email=my_email@example.com&amp;ids=10.1093/nar/gks1195&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
We will call our tool "org-ref" and use the value of user-mail-address. The URL above returns XML, so we can parse it, and then extract the identifiers. This is a simple http GET request, which we can construct using url-retrieve-synchronously. Here is what we get.
&lt;/p&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;let*&lt;/span&gt; ((url-request-method &lt;span style="color: #008000;"&gt;"GET"&lt;/span&gt;)
       (doi&lt;span style="color: #008000;"&gt;"10.1093/nar/gks1195"&lt;/span&gt;)
       (my-tool &lt;span style="color: #008000;"&gt;"org-ref"&lt;/span&gt;)
       (url (format &lt;span style="color: #008000;"&gt;"http://www.ncbi.nlm.nih.gov/pmc/utils/idconv/v1.0/?tool=%s&amp;amp;email=%s&amp;amp;ids=%s"&lt;/span&gt;
                    my-tool
                    user-mail-address
                    doi))
       (xml (&lt;span style="color: #0000FF;"&gt;with-current-buffer&lt;/span&gt;  (url-retrieve-synchronously url)
                (xml-parse-region url-http-end-of-headers (point-max)))))
xml)
&lt;/pre&gt;
&lt;/div&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;((pmcids
  ((status . &lt;span style="color: #008000;"&gt;"ok"&lt;/span&gt;))
  &lt;span style="color: #008000;"&gt;"\n"&lt;/span&gt;
  (request
   ((idtype . &lt;span style="color: #008000;"&gt;"doi"&lt;/span&gt;)
    (dois . &lt;span style="color: #008000;"&gt;""&lt;/span&gt;)
    (versions . &lt;span style="color: #008000;"&gt;"yes"&lt;/span&gt;)
    (showaiid . &lt;span style="color: #008000;"&gt;"no"&lt;/span&gt;))
   &lt;span style="color: #008000;"&gt;"\n"&lt;/span&gt;
   (echo nil &lt;span style="color: #008000;"&gt;"tool=org-ref;email=jkitchin%40andrew.cmu.edu;ids=10.1093%2Fnar%2Fgks1195"&lt;/span&gt;)
   &lt;span style="color: #008000;"&gt;"\n"&lt;/span&gt;)
  &lt;span style="color: #008000;"&gt;"\n"&lt;/span&gt;
  (record
   ((requested-id . &lt;span style="color: #008000;"&gt;"10.1093/NAR/GKS1195"&lt;/span&gt;)
    (pmcid . &lt;span style="color: #008000;"&gt;"PMC3531190"&lt;/span&gt;)
    (pmid . &lt;span style="color: #008000;"&gt;"23193287"&lt;/span&gt;)
    (doi . &lt;span style="color: #008000;"&gt;"10.1093/nar/gks1195"&lt;/span&gt;))
   (versions nil
             (version
              ((pmcid . &lt;span style="color: #008000;"&gt;"PMC3531190.1"&lt;/span&gt;)
               (current . &lt;span style="color: #008000;"&gt;"true"&lt;/span&gt;)))))
  &lt;span style="color: #008000;"&gt;"\n"&lt;/span&gt;))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
The parsed xml is now just an emacs-lisp data structure. We need to get the record, and then get the attributes of it to extract the identifiers. Next, we create a plist of the identifiers. For fun, we add the Scopus EID and WOS accession number from the previous posts too.
&lt;/p&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;let*&lt;/span&gt; ((url-request-method &lt;span style="color: #008000;"&gt;"GET"&lt;/span&gt;)
       (doi&lt;span style="color: #008000;"&gt;"10.1093/nar/gks1195"&lt;/span&gt;)
       (my-tool &lt;span style="color: #008000;"&gt;"org-ref"&lt;/span&gt;)
       (url (format &lt;span style="color: #008000;"&gt;"http://www.ncbi.nlm.nih.gov/pmc/utils/idconv/v1.0/?tool=%s&amp;amp;email=%s&amp;amp;ids=%s"&lt;/span&gt;
                    my-tool
                    user-mail-address
                    doi))
       (xml (car (&lt;span style="color: #0000FF;"&gt;with-current-buffer&lt;/span&gt;  (url-retrieve-synchronously url)
                   (xml-parse-region url-http-end-of-headers (point-max)))))
       (record (first  (xml-get-children xml 'record)))
       (doi (xml-get-attribute record 'doi))
       (pmcid (xml-get-attribute record 'pmcid))
       (pmid (xml-get-attribute record 'pmid)))
  (list &lt;span style="color: #006FE0;"&gt;:doi&lt;/span&gt; doi &lt;span style="color: #006FE0;"&gt;:pmid&lt;/span&gt; pmid &lt;span style="color: #006FE0;"&gt;:pmcid&lt;/span&gt; pmcid &lt;span style="color: #006FE0;"&gt;:eid&lt;/span&gt; (scopus-doi-to-eid doi) &lt;span style="color: #006FE0;"&gt;:wos&lt;/span&gt; (wos-doi-to-accession-number doi)))
&lt;/pre&gt;
&lt;/div&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #006FE0;"&gt;:doi&lt;/span&gt; &lt;span style="color: #008000;"&gt;"10.1093/nar/gks1195"&lt;/span&gt; &lt;span style="color: #006FE0;"&gt;:pmid&lt;/span&gt; &lt;span style="color: #008000;"&gt;"23193287"&lt;/span&gt; &lt;span style="color: #006FE0;"&gt;:pmcid&lt;/span&gt; &lt;span style="color: #008000;"&gt;"PMC3531190"&lt;/span&gt; &lt;span style="color: #006FE0;"&gt;:eid&lt;/span&gt; &lt;span style="color: #008000;"&gt;"2-s2.0-80053651587"&lt;/span&gt; &lt;span style="color: #006FE0;"&gt;:wos&lt;/span&gt; &lt;span style="color: #008000;"&gt;"000312893300006"&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
Well, there you have it, four new scientific document ids from one DOI. &lt;i&gt;Of course&lt;/i&gt; we have defined org-mode links for each one of these:
&lt;/p&gt;

&lt;p&gt;
&lt;a href="https://doi.org/10.1093/nar/gks1195"&gt;doi:10.1093/nar/gks1195&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.ncbi.nlm.nih.gov/pmc/articles/mid/23193287"&gt;pmid:23193287&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3531190"&gt;pmcid:PMC3531190&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href=" http://www.scopus.com/record/display.url?eid=2-s2.0-80053651587&amp;origin=resultslist"&gt;eid:2-s2.0-80053651587&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&amp;rft_id=info:ut/000312893300006"&gt;wos:000312893300006&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
I have not tested this on too many DOIs yet. Not all of them are indexed by Pubmed.
&lt;/p&gt;
&lt;p&gt;Copyright (C) 2015 by John Kitchin. See the &lt;a href="/copying.html"&gt;License&lt;/a&gt; for information about copying.&lt;p&gt;&lt;p&gt;&lt;a href="/org/2015/06/09/Converting-a-DOI-to-other-scientific-identifiers-in-Pubmed.org"&gt;org-mode source&lt;/a&gt;&lt;p&gt;&lt;p&gt;Org-mode version = 8.2.10&lt;/p&gt;
]]></content:encoded>
    </item>
    <item>
      <title>Getting a WOS Accession number from a DOI</title>
      <link>https://kitchingroup.cheme.cmu.edu/blog/2015/06/08/Getting-a-WOS-Accession-number-from-a-DOI</link>
      <pubDate>Mon, 08 Jun 2015 11:23:33 EDT</pubDate>
      <category><![CDATA[orgmode]]></category>
      <category><![CDATA[ref]]></category>
      <guid isPermaLink="false">zJd9kXZpayDWXeKvKZ393FMDrQY=</guid>
      <description>Getting a WOS Accession number from a DOI</description>
      <content:encoded><![CDATA[


&lt;p&gt;
I have been slowly working on getting alternative identifiers to the DOI for scientific literature. The DOI is great for getting a bibtex entry, and getting to the article page, but other identifiers, e.g. from Pubmed, Scopus or Web of Science provide links to additional information. Here, I examine an approach to get a Web of Science identifier from a DOI.
&lt;/p&gt;

&lt;p&gt;
In a previous &lt;a href="http://kitchingroup.cheme.cmu.edu/blog/2014/11/04/Accessing-web-of-science-entry-citing-and-related-articles-from-a-doi-in-emacs/"&gt;post&lt;/a&gt; we showed how to use the Web of Science OpenURL services to derive links to articles from the DOI. It turns out that if you follow that link, you get redirected to a URL that has the WOS Accession number in it. For example, this link: &lt;a href="http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&amp;rft_id=info:doi/10.1021/jp047349j"&gt;http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&amp;rft_id=info:doi/10.1021/jp047349j&lt;/a&gt; is redirected to
&lt;a href="http://gateway.webofknowledge.com/gateway/Gateway.cgi?GWVersion=2&amp;SrcApp=PARTNER_APP&amp;SrcAuth=LinksAMR&amp;KeyUT=WOS:000225079300029&amp;DestLinkType=FullRecord&amp;DestApp=ALL_WOS&amp;UsrCustomerID=8703b88d69db6b417a9c0dc510538f44"&gt;http://gateway.webofknowledge.com/gateway/Gateway.cgi?GWVersion=2&amp;SrcApp=PARTNER_APP&amp;SrcAuth=LinksAMR&amp;KeyUT=WOS:000225079300029&amp;DestLinkType=FullRecord&amp;DestApp=ALL_WOS&amp;UsrCustomerID=8703b88d69db6b417a9c0dc510538f44&lt;/a&gt; . You can see the &lt;a href="http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&amp;rft_id=info:ut/000225079300029"&gt;wos:000225079300029&lt;/a&gt; in that URL, so all we need to do is extract it. We use some url functions in emacs lisp to to that. They are a little convoluted, but they work. Previously I used a regular expression to do this.
&lt;/p&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(cdr (assoc &lt;span style="color: #008000;"&gt;"KeyUT"&lt;/span&gt; (url-parse-query-string (url-filename (url-generic-parse-url  &lt;span style="color: #008000;"&gt;"http://gateway.webofknowledge.com/gateway/Gateway.cgi?GWVersion=2&amp;amp;SrcApp=PARTNER_APP&amp;amp;SrcAuth=LinksAMR&amp;amp;KeyUT=WOS:000225079300029&amp;amp;DestLinkType=FullRecord&amp;amp;DestApp=ALL_WOS&amp;amp;UsrCustomerID=8703b88d69db6b417a9c0dc510538f44"&lt;/span&gt;)))))
&lt;/pre&gt;
&lt;/div&gt;

&lt;table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"&gt;


&lt;colgroup&gt;
&lt;col  class="left" /&gt;
&lt;/colgroup&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="left"&gt;&lt;a href="000225079300029"&gt;000225079300029&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;
It is a tad tricky to get the redirected URL. We have to use the most basic url-retrieve, which works asynchronously, and we need a callback function to handle the response. I use a trick with global variables to note that the function is waiting, and to sleep briefly until it is ready. We want the last redirect (this seems to get redirected twice).
&lt;/p&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;defvar&lt;/span&gt; &lt;span style="color: #BA36A5;"&gt;*wos-redirect*&lt;/span&gt; nil)
(&lt;span style="color: #0000FF;"&gt;defvar&lt;/span&gt; &lt;span style="color: #BA36A5;"&gt;*wos-waiting*&lt;/span&gt; nil)

(&lt;span style="color: #0000FF;"&gt;defun&lt;/span&gt; &lt;span style="color: #006699;"&gt;wos-get-wos-redirect&lt;/span&gt; (url)
  &lt;span style="color: #036A07;"&gt;"Return final redirect url for open-url"&lt;/span&gt;
  (&lt;span style="color: #0000FF;"&gt;setq&lt;/span&gt; *wos-waiting* t)
  (url-retrieve
   url
   (&lt;span style="color: #0000FF;"&gt;lambda&lt;/span&gt; (status)
     (&lt;span style="color: #0000FF;"&gt;setq&lt;/span&gt; *wos-redirect* (car (last status)))
     (&lt;span style="color: #0000FF;"&gt;setq&lt;/span&gt; *wos-waiting* nil)))
  (&lt;span style="color: #0000FF;"&gt;while&lt;/span&gt; *wos-waiting* (sleep-for 0.1))
  (url-unhex-string *wos-redirect*))


(&lt;span style="color: #0000FF;"&gt;defun&lt;/span&gt; &lt;span style="color: #006699;"&gt;wos-doi-to-accession-number&lt;/span&gt; (doi)
  &lt;span style="color: #036A07;"&gt;"Return a WOS Accession number for a DOI."&lt;/span&gt;
  (&lt;span style="color: #0000FF;"&gt;let*&lt;/span&gt; ((open-url (concat &lt;span style="color: #008000;"&gt;"http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&amp;amp;rft_id=info:doi/"&lt;/span&gt; doi))
         (redirect (wos-get-wos-redirect open-url)))
    (substring  (cadr
                 (assoc
                  &lt;span style="color: #008000;"&gt;"KeyUT"&lt;/span&gt;
                  (url-parse-query-string
                   (url-filename
                    (url-generic-parse-url redirect)))))
    4)))

(concat &lt;span style="color: #008000;"&gt;"wos:"&lt;/span&gt; (wos-doi-to-accession-number &lt;span style="color: #008000;"&gt;"10.1021/jp047349j"&lt;/span&gt;))
&lt;/pre&gt;
&lt;/div&gt;

&lt;pre class="example"&gt;
wos:000225079300029
&lt;/pre&gt;

&lt;p&gt;
I am not super crazy about this approach, but until I figure out the WOK API, this is surprisingly simple! And, now you can use the Accession number in a url like these examples:
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://onlinelibrary.wiley.com/resolve/reference/ISI?id=000225079300029"&gt;http://onlinelibrary.wiley.com/resolve/reference/ISI?id=000225079300029&lt;/a&gt; 
&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&amp;rft_id=info:ut/000225079300029"&gt;http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&amp;rft_id=info:ut/000225079300029&lt;/a&gt; 
&lt;/p&gt;

&lt;p&gt;
That might turn out to be handy at some point.
&lt;/p&gt;
&lt;p&gt;Copyright (C) 2015 by John Kitchin. See the &lt;a href="/copying.html"&gt;License&lt;/a&gt; for information about copying.&lt;p&gt;&lt;p&gt;&lt;a href="/org/2015/06/08/Getting-a-WOS-Accession-number-from-a-DOI.org"&gt;org-mode source&lt;/a&gt;&lt;p&gt;&lt;p&gt;Org-mode version = 8.2.10&lt;/p&gt;]]></content:encoded>
    </item>
    <item>
      <title>Getting a Scopus EID from a DOI</title>
      <link>https://kitchingroup.cheme.cmu.edu/blog/2015/06/07/Getting-a-Scopus-EID-from-a-DOI</link>
      <pubDate>Sun, 07 Jun 2015 16:29:05 EDT</pubDate>
      <category><![CDATA[orgmode]]></category>
      <category><![CDATA[ref]]></category>
      <guid isPermaLink="false">uGisWjD0YwUZV5rTEdgcVyD08u0=</guid>
      <description>Getting a Scopus EID from a DOI</description>
      <content:encoded><![CDATA[


&lt;p&gt;
&lt;a href="http://www.scopus.com"&gt;Scopus&lt;/a&gt; is a scientific literature indexing and search engine service run by Elsevier. I have been integrating Scopus workflows into Emacs  and org-ref. Scopus seems to work with their own digital identifiers, known as an EID. I usually have a DOI to work with. Here, we develop a way to get an EID from a DOI using the Scopus API. You need to get your own Scopus API key here: &lt;a href="http://dev.elsevier.com/myapikey.html"&gt;http://dev.elsevier.com/myapikey.html&lt;/a&gt; and set &lt;b&gt;scopus-api-key&lt;/b&gt; in Emacs to use this code.
&lt;/p&gt;

&lt;p&gt;
Once we have an EID, here are a few interesting things we can do with them. This is an EID: 2-s2.0-84881394200, for this reference:
&lt;/p&gt;

&lt;p&gt;
Hallenbeck, Alexander P. and Kitchin, John R., "Effects of \ce{O_2} and \ce{SO_2} on the capture capacity of a  primary-amine based polymeric \ce{CO_2} sorbent", Industrial &amp;amp; Engineering Chemistry Research, 52:10788-10794 (2013)
&lt;/p&gt;

&lt;p&gt;
With the EID, we can construct a URL to the Scopus document page:
&lt;/p&gt;
&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;let&lt;/span&gt; ((eid &lt;span style="color: #008000;"&gt;"2-s2.0-84881394200"&lt;/span&gt;))
  (format &lt;span style="color: #008000;"&gt;"http://www.scopus.com/record/display.url?eid=%s&amp;amp;origin=resultslist"&lt;/span&gt; eid))
&lt;/pre&gt;
&lt;/div&gt;

&lt;pre class="example"&gt;
http://www.scopus.com/record/display.url?eid=2-s2.0-84881394200&amp;amp;origin=resultslist
&lt;/pre&gt;

&lt;p&gt;
We can construct a URL to citing documents:
&lt;/p&gt;
&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;let&lt;/span&gt; ((eid &lt;span style="color: #008000;"&gt;"2-s2.0-84881394200"&lt;/span&gt;))
  (format &lt;span style="color: #008000;"&gt;"http://www.scopus.com/results/citedbyresults.url?sort=plf-f&amp;amp;cite=%s&amp;amp;src=s&amp;amp;imp=t&amp;amp;sot=cite&amp;amp;sdt=a&amp;amp;sl=0&amp;amp;origin=recordpage"&lt;/span&gt; eid))
&lt;/pre&gt;
&lt;/div&gt;

&lt;pre class="example"&gt;
http://www.scopus.com/results/citedbyresults.url?sort=plf-f&amp;amp;cite=2-s2.0-84881394200&amp;amp;src=s&amp;amp;imp=t&amp;amp;sot=cite&amp;amp;sdt=a&amp;amp;sl=0&amp;amp;origin=recordpage
&lt;/pre&gt;

&lt;p&gt;
And there are three types of related document urls we can create: by author, keyword or references.
&lt;/p&gt;

&lt;p&gt;
By authors:
&lt;/p&gt;
&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;let&lt;/span&gt; ((eid &lt;span style="color: #008000;"&gt;"2-s2.0-84881394200"&lt;/span&gt;))
  (format (concat &lt;span style="color: #008000;"&gt;"http://www.scopus.com/search/submit/mlt.url"&lt;/span&gt;
                  &lt;span style="color: #008000;"&gt;"?eid=%s&amp;amp;src=s&amp;amp;all=true&amp;amp;origin=recordpage"&lt;/span&gt;
                  &lt;span style="color: #008000;"&gt;"&amp;amp;method=aut&amp;amp;zone=relatedDocuments"&lt;/span&gt;)
            eid))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;a href="http://www.scopus.com/search/submit/mlt.url?eid=2-s2.0-84881394200&amp;src=s&amp;all=true&amp;origin=recordpage&amp;method=aut&amp;zone=relatedDocuments"&gt;http://www.scopus.com/search/submit/mlt.url?eid=2-s2.0-84881394200&amp;src=s&amp;all=true&amp;origin=recordpage&amp;method=aut&amp;zone=relatedDocuments&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
By keywords:
&lt;/p&gt;
&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;let&lt;/span&gt; ((eid &lt;span style="color: #008000;"&gt;"2-s2.0-84881394200"&lt;/span&gt;))
  (format (concat &lt;span style="color: #008000;"&gt;"http://www.scopus.com/search/submit/mlt.url"&lt;/span&gt;
                  &lt;span style="color: #008000;"&gt;"?eid=%s&amp;amp;src=s&amp;amp;all=true&amp;amp;origin=recordpage"&lt;/span&gt;
                  &lt;span style="color: #008000;"&gt;"&amp;amp;method=key&amp;amp;zone=relatedDocuments"&lt;/span&gt;)
          eid))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;a href="http://www.scopus.com/search/submit/mlt.url?eid=2-s2.0-84881394200&amp;src=s&amp;all=true&amp;origin=recordpage&amp;method=key&amp;zone=relatedDocuments"&gt;http://www.scopus.com/search/submit/mlt.url?eid=2-s2.0-84881394200&amp;src=s&amp;all=true&amp;origin=recordpage&amp;method=key&amp;zone=relatedDocuments&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
And by references:
&lt;/p&gt;
&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;let&lt;/span&gt; ((eid &lt;span style="color: #008000;"&gt;"2-s2.0-84881394200"&lt;/span&gt;))
  (format (concat  &lt;span style="color: #008000;"&gt;"http://www.scopus.com/search/submit/mlt.url?"&lt;/span&gt;
                   &lt;span style="color: #008000;"&gt;"eid=%s&amp;amp;src=s&amp;amp;all=true&amp;amp;origin=recordpage"&lt;/span&gt;
                   &lt;span style="color: #008000;"&gt;"&amp;amp;method=ref&amp;amp;zone=relatedDocuments"&lt;/span&gt;)
           eid))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;a href="http://www.scopus.com/search/submit/mlt.url?eid=2-s2.0-84881394200&amp;src=s&amp;all=true&amp;origin=recordpage&amp;method=ref&amp;zone=relatedDocuments"&gt;http://www.scopus.com/search/submit/mlt.url?eid=2-s2.0-84881394200&amp;src=s&amp;all=true&amp;origin=recordpage&amp;method=ref&amp;zone=relatedDocuments&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
We can generate all those on the fly if we have an EID. The problem is that we usually have the DOI, &lt;i&gt;not&lt;/i&gt; the EID. So, here we use the Scopus API to retrieve that. Basically, we just do a search on the DOI, assume one and only one is found, and get the EID from the results. The DOI we have for the reference considered here is &lt;a href="https://doi.org/10.1021/ie400582a"&gt;doi:10.1021/ie400582a&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
The gist of what we will do is send an http request to Scopus with our API key, and data specifying what to get. Scopus will return data to us in either json or xml, depending on what we ask for.
&lt;/p&gt;

&lt;p&gt;
I find json easiest to deal with, so we first work it out in json. We use the Scopus search API and query on the doi here. We get back json data which we read as an emacs-lisp plist, and extract the eid from it.
&lt;/p&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;let*&lt;/span&gt; ((doi &lt;span style="color: #008000;"&gt;"10.1021/ie400582a"&lt;/span&gt;)
       (url-request-method &lt;span style="color: #008000;"&gt;"GET"&lt;/span&gt;)
       (url-mime-accept-string &lt;span style="color: #008000;"&gt;"application/json"&lt;/span&gt;)
       (url-request-extra-headers  (list (cons &lt;span style="color: #008000;"&gt;"X-ELS-APIKey"&lt;/span&gt; *scopus-api-key*)
                                         '(&lt;span style="color: #008000;"&gt;"field"&lt;/span&gt; . &lt;span style="color: #008000;"&gt;"eid"&lt;/span&gt;)))
       (url (format  &lt;span style="color: #008000;"&gt;"http://api.elsevier.com/content/search/scopus?query=doi(%s)"&lt;/span&gt; doi))
       (json-object-type 'plist)
       (json-data (&lt;span style="color: #0000FF;"&gt;with-current-buffer&lt;/span&gt;  (url-retrieve-synchronously url)
                    (json-read-from-string
                     (buffer-substring url-http-end-of-headers (point-max))))))
 (plist-get (elt (plist-get (plist-get json-data &lt;span style="color: #006FE0;"&gt;:search-results&lt;/span&gt;) &lt;span style="color: #006FE0;"&gt;:entry&lt;/span&gt;) 0) &lt;span style="color: #006FE0;"&gt;:eid&lt;/span&gt;))
&lt;/pre&gt;
&lt;/div&gt;

&lt;pre class="example"&gt;
2-s2.0-84881394200
&lt;/pre&gt;

&lt;p&gt;
That is the EID we were looking for. Here, we just wrap that code in a function so it is easier to reuse.
&lt;/p&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;defun&lt;/span&gt; &lt;span style="color: #006699;"&gt;scopus-doi-to-eid-json&lt;/span&gt; (doi)
  &lt;span style="color: #036A07;"&gt;"Return a parsed xml from the Scopus article retrieval api for DOI.&lt;/span&gt;
&lt;span style="color: #036A07;"&gt;This does not always seem to work for the most recent DOIs."&lt;/span&gt;
  (&lt;span style="color: #0000FF;"&gt;let*&lt;/span&gt; ((url-request-method &lt;span style="color: #008000;"&gt;"GET"&lt;/span&gt;)
         (url-mime-accept-string &lt;span style="color: #008000;"&gt;"application/json"&lt;/span&gt;)
         (url-request-extra-headers  (list (cons &lt;span style="color: #008000;"&gt;"X-ELS-APIKey"&lt;/span&gt; *scopus-api-key*)
                                           '(&lt;span style="color: #008000;"&gt;"field"&lt;/span&gt; . &lt;span style="color: #008000;"&gt;"eid"&lt;/span&gt;)))
         (url (format  &lt;span style="color: #008000;"&gt;"http://api.elsevier.com/content/search/scopus?query=doi(%s)"&lt;/span&gt; doi))
         (json-object-type 'plist)
         (json-data (&lt;span style="color: #0000FF;"&gt;with-current-buffer&lt;/span&gt;  (url-retrieve-synchronously url)
                      (json-read-from-string
                       (buffer-substring url-http-end-of-headers (point-max))))))
    (plist-get (elt (plist-get (plist-get json-data &lt;span style="color: #006FE0;"&gt;:search-results&lt;/span&gt;) &lt;span style="color: #006FE0;"&gt;:entry&lt;/span&gt;) 0) &lt;span style="color: #006FE0;"&gt;:eid&lt;/span&gt;)))

(scopus-doi-to-eid &lt;span style="color: #008000;"&gt;"10.1021/ie400582a"&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
XML is the native format in the Scopus API. They say that json works most of the time, but some XML cannot be rendered as json. Here we use the XML returned to get the EID. It is less intuitive to me, but mostly because I have used it less. I don't think you can specify and XPATH like you can in Python.
&lt;/p&gt;

&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;let*&lt;/span&gt; ((doi &lt;span style="color: #008000;"&gt;"10.1021/ie400582a"&lt;/span&gt;)
       (url-request-method &lt;span style="color: #008000;"&gt;"GET"&lt;/span&gt;)
       (url-mime-accept-string &lt;span style="color: #008000;"&gt;"application/xml"&lt;/span&gt;)
       (url-request-extra-headers  (list (cons &lt;span style="color: #008000;"&gt;"X-ELS-APIKey"&lt;/span&gt; *scopus-api-key*)
                                         '(&lt;span style="color: #008000;"&gt;"field"&lt;/span&gt; . &lt;span style="color: #008000;"&gt;"eid"&lt;/span&gt;)))
       (url (format  &lt;span style="color: #008000;"&gt;"http://api.elsevier.com/content/search/scopus?query=doi(%s)"&lt;/span&gt; doi))
       (xml (&lt;span style="color: #0000FF;"&gt;with-current-buffer&lt;/span&gt;  (url-retrieve-synchronously url)
              (xml-parse-region url-http-end-of-headers (point-max))))
       (results (car xml))
       (entry (car (xml-get-children results 'entry))))
  (car (xml-node-children (car (xml-get-children entry 'eid)))))
&lt;/pre&gt;
&lt;/div&gt;

&lt;pre class="example"&gt;
2-s2.0-84881394200
&lt;/pre&gt;

&lt;p&gt;
Now we wrap this in a function for reusability.
&lt;/p&gt;
&lt;div class="org-src-container"&gt;

&lt;pre class="src src-emacs-lisp"&gt;(&lt;span style="color: #0000FF;"&gt;defun&lt;/span&gt; &lt;span style="color: #006699;"&gt;scopus-doi-to-eid&lt;/span&gt; (doi)
  &lt;span style="color: #036A07;"&gt;"Get a Scopus eid from a DOI."&lt;/span&gt;
  (&lt;span style="color: #0000FF;"&gt;let*&lt;/span&gt; ((url-request-method &lt;span style="color: #008000;"&gt;"GET"&lt;/span&gt;)
         (url-mime-accept-string &lt;span style="color: #008000;"&gt;"application/xml"&lt;/span&gt;)
         (url-request-extra-headers  (list (cons &lt;span style="color: #008000;"&gt;"X-ELS-APIKey"&lt;/span&gt; *scopus-api-key*)
                                           '(&lt;span style="color: #008000;"&gt;"field"&lt;/span&gt; . &lt;span style="color: #008000;"&gt;"eid"&lt;/span&gt;)))
         (url (format  &lt;span style="color: #008000;"&gt;"http://api.elsevier.com/content/search/scopus?query=doi(%s)"&lt;/span&gt; doi))
         (xml (&lt;span style="color: #0000FF;"&gt;with-current-buffer&lt;/span&gt;  (url-retrieve-synchronously url)
                (xml-parse-region url-http-end-of-headers (point-max))))
         (results (car xml))
         (entry (car (xml-get-children results 'entry))))
    (car (xml-node-children (car (xml-get-children entry 'eid))))))

(scopus-doi-to-eid &lt;span style="color: #008000;"&gt;"10.1021/ie400582a"&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;

&lt;pre class="example"&gt;
2-s2.0-84881394200
&lt;/pre&gt;

&lt;p&gt;
This code is wrapped up in &lt;a href="https://github.com/jkitchin/org-ref/blob/master/scopus.el"&gt;org-ref/scopus.el&lt;/a&gt; . It provides a new org-mode eid link, e.g. &lt;a href=" http://www.scopus.com/record/display.url?eid=2-s2.0-84881394200&amp;origin=resultslist"&gt;eid:2-s2.0-84881394200&lt;/a&gt; which is functional and provides access to the citing and related article Scopus pages for that eid.
&lt;/p&gt;

&lt;p&gt;
There are also new links and functions for a &lt;a href="http://www.scopus.com/results/results.url?sort=plf-f&amp;src=s&amp;sot=b&amp;sdt=b&amp;sl=35&amp;s=TITLE-ABS-KEY%28alloy%20Au%20segregation%29&amp;origin=searchbasic"&gt;alloy Au segregation&lt;/a&gt; and &lt;a href="http://www.scopus.com/results/results.url?sort=plf-f&amp;src=s&amp;sot=a&amp;sdt=a&amp;sl=48&amp;s=auth%28kitchin%29%20and%20title%28segregation%29&amp;origin=searchadvanced"&gt;auth(kitchin) and title(segregation)&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Let's not forget the &lt;a href="http://www.scopus.com/authid/detail.url?origin=AuthorProfile&amp;authorId=7004212771"&gt;scopusid:7004212771&lt;/a&gt; link to Scopus Author pages.
&lt;/p&gt;

&lt;p&gt;
Now you can use org-mode for reproducible scientific literature searching in Scopus!
&lt;/p&gt;
&lt;p&gt;Copyright (C) 2015 by John Kitchin. See the &lt;a href="/copying.html"&gt;License&lt;/a&gt; for information about copying.&lt;p&gt;&lt;p&gt;&lt;a href="/org/2015/06/07/Getting-a-Scopus-EID-from-a-DOI.org"&gt;org-mode source&lt;/a&gt;&lt;p&gt;&lt;p&gt;Org-mode version = 8.2.10&lt;/p&gt;
]]></content:encoded>
    </item>
  </channel>
</rss>
