Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzupkoii committed Sep 29, 2024
2 parents b90e6a3 + b9a77f9 commit 392368c
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 7 deletions.
2 changes: 1 addition & 1 deletion _includes/author-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3 class="author__name">{{ author.name }}</h3>
<li class="author__desktop"><i class="fa-solid fa-location-dot icon-pad-right" aria-hidden="true"></i>{{ author.location }}</li>
{% endif %}
{% if author.employer %}
<li class="author__desktop"><i class="fa fa-solid fa-building-columns icon-pad-right" aria-hidden="true"></i>{{ author.employer }}</li>
<li class="author__desktop"><i class="fas fa-fw fa-building-columns icon-pad-right" aria-hidden="true"></i>{{ author.employer }}</li>
{% endif %}
{% if author.uri %}
<li><a href="{{ author.uri }}"><i class="fas fa-fw fa-link icon-pad-right" aria-hidden="true"></i>{{ site.data.ui-text[site.locale].website_label | default: "Website" }}</a></li>
Expand Down
4 changes: 2 additions & 2 deletions _sass/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
@include clearfix;
margin-left: auto;
margin-right: auto;
margin-top: 2em;
margin-top: 1em;
max-width: 100%;
padding: 0 1em 2em;
padding: 0 1em 1em;

@include breakpoint($x-large) {
max-width: $x-large;
Expand Down
2 changes: 1 addition & 1 deletion _sass/_masthead.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
white-space: nowrap;

&--lg {
padding-right: 3em;
padding-right: 2em;
font-weight: 700;
}
}
1 change: 1 addition & 0 deletions _sass/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@
font-weight: bold;
line-height: 1.5;
border-bottom: 1px solid $border-color;
text-decoration-line: none !important;

&:hover {
color: #000;
Expand Down
6 changes: 3 additions & 3 deletions _sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ $x-large : 1280px !default;
Grid
========================================================================== */

$right-sidebar-width-narrow : 0px;
$right-sidebar-width : 0px;
$right-sidebar-width-wide : 0px;
$right-sidebar-width-narrow : 200px !default;
$right-sidebar-width : 300px !default;
$right-sidebar-width-wide : 400px !default;

$susy: (
columns: 12,
Expand Down
118 changes: 118 additions & 0 deletions scripts/OrcidToBib.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "01f0c5c2-619a-48e0-bb7c-e5e0be009f0e",
"metadata": {},
"outputs": [],
"source": [
"orcid = '0000-0000-0000-0000' # Fill your orcid here"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2fe4bc4e-4574-4322-8b18-0c4d33a749fa",
"metadata": {},
"outputs": [],
"source": [
"import requests"
]
},
{
"cell_type": "markdown",
"id": "44a8b6cd-4034-4fc4-85a8-e3431dc564f1",
"metadata": {},
"source": [
"We use the `/works` api to list all works related to the orcid. This gives a summary of all works, so citation information is not included. We collect the `put-code` of all works to retrieve the citation information later."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3b04331e-4149-4ca3-a0aa-89e3ba892723",
"metadata": {},
"outputs": [],
"source": [
"response = requests.get('https://pub.orcid.org/v3.0/{}/works'.format(orcid),\n",
" headers={\"Accept\": \"application/orcid+json\" })\n",
"record = response.json()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "16f7c42d-623b-421a-8d87-bbb389313e3b",
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"put_codes = []\n",
"for work in record['group']:\n",
" put_code = work['work-summary'][0]['put-code']\n",
" put_codes.append(put_code)\n",
"put_code = put_codes[0]"
]
},
{
"cell_type": "markdown",
"id": "25e5d2aa-5233-486e-abce-a0d07a36c5ce",
"metadata": {},
"source": [
"We use the `/<orcid>/work/<put-code>` endpoint to retrieve the citation information for each record."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "dd797a16-0d91-4271-8e1e-b82579a07e45",
"metadata": {},
"outputs": [],
"source": [
"citations = []\n",
"for put_code in put_codes:\n",
" response = requests.get('https://pub.orcid.org/v3.0/{}/work/{}'.format(orcid, put_code),\n",
" headers={\"Accept\": \"application/orcid+json\" })\n",
" work = response.json()\n",
" if work['citation'] is not None:\n",
" citations.append(work['citation']['citation-value'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ad763df9-261f-41f3-bc32-00921d0a4e11",
"metadata": {},
"outputs": [],
"source": [
"with open('output.bib', 'w') as bibfile:\n",
" for citation in citations:\n",
" bibfile.write(citation)\n",
" bibfile.write('\\n')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit 392368c

Please sign in to comment.