The package includes a simple Python code to automatically fetch h-index from the SAO/NASA Astrophysics Data System (ADS) for a given ORCID (Open Researcher and Contributor ID), and an example PHP code (see below) on how to display the h-index on a webpage.
IMPORTANT: Please note that the latest h-index is automatically fetched from the ADS for all your publications linked to your ORCID. As such, it works correctly only if all your publications in the ADS have been linked (claimed) to your ORCID. See here on how to link your publications and ORCID in the ADS.
- Create an account at the SAO/NASA Astrophysics Data System (ADS), if you do not already have one.
- Login into your ADS account.
- Generate a new key under Settings > API token.
- Replace the Your_ADS_API_Token in line 21 of the Python code (compute_h_index.py) with your generated API key.
- Upload the Python code in to your server (i.e., where your other webpages are).
- If your webpage is in HTML, change the extension from
.html
to.php
(i.e., change the file name frommy_webpage.html
tomy_webpage.php
) - Create an ORCID iD, if you do not have one.
- Add the following PHP code in
my_webpage.php
, where you want to display the h-index (in between your other HTML or PHP codes), and replace the YOUR_ORCID_ID with yours (only the number, e.g.,0000-0002-7711-5397
).
<?php
$orcid = 'YOUR_ORCID_ID';
$h_index = exec("python3 compute_h_index.py $orcid");
$pid = intval(exec('python3 compute_h_index.py'));
exec("kill $pid");
echo $h_index;
?>
See an example at https://WaLSA.team/Shahin.Jafarzadeh