## Altmetrics meet my publications

| categories: | tags: | View Comments

Altmetrics is an alternative to simple citation counts of articles. Altmetrics looks at how your papers are mentioned in Tweets, google+, blog posts, news, how many Mendeley users have the article, etc… They are partnering with publishers to provide additional metrics on your papers.

You can put some Altmetric badges on your papers so you can see how they are doing. In this post, we scrape out my papers from my orcid page, and add Altmetric badges to them. This is basically just a little snippet of html code that will put the Altmetric donut in the citation, which has some information about the number of times each paper is tweeted, etc…

So, here is a python script that will print some html results. We print each title with the Altmetric donut, and we add a Scopus Cited by count for each paper.

import requests
import json

resp = requests.get("http://pub.orcid.org/0000-0003-2625-9232/orcid-works",
results = resp.json()

data = []
TITLES, DOIs = [], []

scopus_cite = "<img src=\"http://api.elsevier.com/content/abstract/citation-count?doi={doi}&amp;httpAccept=image/jpeg&amp;apiKey=5cd06d8a7df3de986bf3d0cd9971a47c\">"
html = '<a href="https://doi.org/{doi}">{title}</a>'

print '<ol>'
for i, result in enumerate( results['orcid-profile']['orcid-activities']
['orcid-works']['orcid-work']):
title = str(result['work-title']['title']['value'].encode('utf-8'))
doi = 'None'

for x in result.get('work-external-identifiers', []):
for eid in result['work-external-identifiers']['work-external-identifier']:
if eid['work-external-identifier-type'] == 'DOI':
doi = str(eid['work-external-identifier-id']['value'].encode('utf-8'))

# AIP journals tend to have a \n in the DOI, and the doi is the second line. we get
# that here.
if len(doi.split('\n')) == 2:
doi = doi.split('\n')[1]

pub_date = result.get('publication-date', None)
if pub_date:
year = pub_date.get('year', None).get('value').encode('utf-8')
else:
year = 'Unknown'

# Try to minimize duplicate entries that are found
dup = False
if title.lower() in TITLES:
dup = True
if (doi != 'None'
and doi.lower() in DOIs):
dup = True

if not dup and doi != 'None':
# truncate title to first 50 characters
print('<li>' + html.format(doi=doi, title=title)
+ '</li>\n')

TITLES.append(title.lower())
DOIs.append(doi.lower())

print '</ol>'


It is a little humbling to see these results! The Altmetric data shows a very different dimension than the citation metrics. It is hard to tell what impact these will have, but they give you another view of who is talking about your work.