Skip to content
Snippets Groups Projects
Commit 0f998d47 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Report the number of citations gathered by the papers

parent 211dc1da
No related branches found
No related tags found
No related merge requests found
...@@ -4,18 +4,23 @@ import sys ...@@ -4,18 +4,23 @@ import sys
# Query papers citing the two SWIFT ADS entries # Query papers citing the two SWIFT ADS entries
query = ADSQueryWrapper(sys.argv[1]) query = ADSQueryWrapper(sys.argv[1])
query_data = query.get("citations(2016pasc.conf....2S) or citations(2018ascl.soft05020S)", fl="title,bibcode,first_author_norm,date,year,author_count,bibstem,abstract,volume,issue,page", rows=1000) query_data = query.get("citations(2016pasc.conf....2S) or citations(2018ascl.soft05020S)", fl="title,bibcode,first_author_norm,date,year,author_count,bibstem,abstract,volume,issue,page,citation_count", rows=1000)
paper_list = query_data.papers paper_list = query_data.papers
total_citations = 0
# Process the data to make the title a string and not an array of strings # Process the data to make the title a string and not an array of strings
for paper in paper_list: for paper in paper_list:
paper.title = paper.title[0] paper.title = paper.title[0]
paper.bibstem = paper.bibstem[0] paper.bibstem = paper.bibstem[0]
if hasattr(paper, "page"):
paper.page = paper.page[0]
if hasattr(paper, "abstract"): if hasattr(paper, "abstract"):
paper.abstract = paper.abstract.replace("<P />", "") paper.abstract = paper.abstract.replace("<P />", "")
total_citations += paper.citation_count
# Create a dictionary of cards # Create a dictionary of cards
my_list = dict({"num_papers": query_data.num_found, my_list = dict({"num_papers": query_data.num_found,
"total_citations": total_citations,
"cards": paper_list}) "cards": paper_list})
# Silence the yaml object naming # Silence the yaml object naming
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
<h2>Publications using SWIFT</h2> <h2>Publications using SWIFT</h2>
</div> </div>
<div> The following {{ num_papers }} publications have made use of SWIFT obtain their results:</div> <div> The following {{ num_papers }} publications have used
SWIFT (directly or indirectly) to obtain their results. They
have jointly gathered {{ total_citations }} citations.</div>
{% set count = num_papers %} {% set count = num_papers %}
...@@ -47,6 +49,7 @@ ...@@ -47,6 +49,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
&emsp;&emsp;(citations: {{ card.citation_count }})
{% if card.abstract %} {% if card.abstract %}
<p class="hideshow">&emsp; Abstract <i class="fa fa-chevron-right" aria-hidden="true"></i></p> <p class="hideshow">&emsp; Abstract <i class="fa fa-chevron-right" aria-hidden="true"></i></p>
<p class="abstract card">{{ card.abstract }}</p> <p class="abstract card">{{ card.abstract }}</p>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment