Adding google scholar citations to google sites. Example
This repo was inspired by the following blog posts:
I found then both on r-bloggers.
This script combined with a job scheduler (like cron) can be used to keep your Google site based website up to date with the data in your Google scholar profile . The pipeline actually goes:
(Scholar) -- [citations.r] --> (Sheets) -- [google gadgets] --> (Sites)
The following instructions are for the file citations.r
, the other files were more for testing purposes.:
- Go to your google scholar profile. The URL should have a term similar to this:
user=VII2oEQAAAAJ
. <-- that's me! - Copy the user value and replace the
user
value incitations.r
- Create a new sheet on google drive, type it some names in two columns in the first row.
- I chose "Year" and "Citations".
- I also named my worksheet "citations".
- Save sheet.
- Change the sharing settings to
Anyone with the link
,Can View
and copy the link generated. - Paste the link in
citations.url
- Once this script runs, the sheet named citations should be populated.
- Insert a chart in your google sites page and make a chart using this spreadsheet.
citations.r
needs to be run the very first time on an IDE like RStudio, this is because of thegooglesheets
dependency.googlesheets
will try and open your default web browser and authenticate the connection. Make sure you check the profile you're signed in as has access to the Google sheet.
- To edit a cron job, type the following in your terminal:
crontab -e
- Add the following two lines, carefully replacing the appropriate values.
[email protected]
@hourly cd /local/path/to/repo && Rscript citations.r
Note:
@hourly
simply asks the cron daemon to execute the command at the top of the hour, every hour, as long as your computer is on. If you're doing this on a coumputer/server that your rarely shutdown, maybe try something like@monthly
.
- Save and exit.
␛:wq ⏎
(Type: escape,colon,w,q,return)