I have been looking for a solution to put my Google Scholar citations on my personal website for quite some time now. Some apps/gadgets seem to have existed to do so (e.g. citations-gadget), but none seem to be functioning today because of changes at Google Scholar, and embedding your entire profile page won't work either. Basically, I had given up my search for a solution, until a few months ago, I discovered a blog post on the R scholar package by James Keirstead (development is taking place on github).
For installing the R scholar package (and its dependencies) in Linux, it is possible you need to install the following packages first (I was running Linux Lite 2.0 on my personal laptop and had to do so):
sudo apt-get install libcurl4-openssl-dev libxml2-dev
Then install the R package using the conventional
in R. After loading the package, you can get the citation history from a Google Scholar profile page (citations per year, as displayed in the bar plot on the right-hand side of the page) using a single function call on the Google Scholar profile ID. Getting the data, and making a plot with the ggplot2 package, which contains a timestamp, is done as follows:
library(scholar) library(ggplot2) cit <- get_citation_history('u421gfwAAAAJ') png('scholar_citations_u421gfwAAAAJ.png',width=800,height=300,res=150) ggplot(cit,aes(x=year,y=cites))+ geom_bar(stat='identity')+ theme_bw()+ xlab('Year of citation')+ ylab('Google Scholar\n cites')+ annotate('text',label=format(Sys.time(), "%Y-%m-%d %H:%M:%S %Z"),x=-Inf,y=Inf,vjust=1.5,hjust=-0.05,size=3,colour='gray') dev.off()With my own humble contribution to science, the resulting image is something like this:
Now, for the automation of this image creation task, you can save the above code as an R script, and simply use cron in Linux. To set up your task with crontab, use
in the terminal and add a single line of text with the instructions to run your script. If you want to execute the script hourly, all you have to do is add a line like this:
0 * * * * cd /home/your/folder && Rscript your_script.R
and save the file. If you do this in a publicly accessible folder, or you can make the image itself publicly accessible (options to do so are Google Drive, Ubuntu One, Dropbox, etc.), you can easily embed it on your personal website with an <img> HTML tag. I currently have it set up like this, so it updates every hour when my personal laptop is switched on. The up-to-date version of the plot above should be online here.
Not so hard after all! :)
Not so hard after all! :)