rossmounce / checkmydois Goto Github PK
View Code? Open in Web Editor NEWCode to check the DOIs of your own authored research outputs (not just articles!)
License: MIT License
Code to check the DOIs of your own authored research outputs (not just articles!)
License: MIT License
when I try this (one of my DOIs) it seems to hang a long time. Do we need a timeout?
http_status(GET("http://doi.org/10.1016/j.neuropharm.2015.07.027"))$message
The paper works ok though when I visit the DOI in a browser.
Investigate cronR
https://github.com/bnosac/cronR
suggested by Thomas https://twitter.com/thomasingalls/status/826437598713294849
Once we have this working, and easily configurable, I would put something like this in the README file?
.travis.yml
is present (not essential)$ORCID
environment variable to your own (see #5)If and when the master fork (i.e. Ross' GItHub repository) is updated, then the user may wish to update their forked copy to get the latest changes
Running locally the output seems overly verbose:
$ Rscript checkmydois.R ; echo "Return code $?"
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
[1] "http://doi.org/10.1111/evo.12884"
[2] "http://doi.org/10.7287/peerj.preprints.773v1"
[3] "http://doi.org/10.3897/rio.1.e7547"
[4] "http://doi.org/10.5334/ban"
[5] "http://doi.org/10.1045/november14-murray-rust"
[6] "http://doi.org/10.3897/bdj.2.e1125"
[7] "http://doi.org/10.4033/iee.2013.6b.14.f"
[8] "http://doi.org/10.1002/bult.2013.1720390406"
[9] "http://doi.org/10.5061/dryad.h6pf365t"
[10] "http://doi.org/10.1186/1756-0500-5-574"
[11] "http://doi.org/10.1038/nature10266"
[12] "http://doi.org/10.1038/npre.2011.6048"
Warning message:
In rm(vec) : object 'vec' not found
matrix.unlist.vec.. uniquedois
1 Success: (200) OK http://doi.org/10.1111/evo.12884
2 Success: (200) OK http://doi.org/10.7287/peerj.preprints.773v1
3 Success: (200) OK http://doi.org/10.3897/rio.1.e7547
4 Success: (200) OK http://doi.org/10.5334/ban
5 Success: (200) OK http://doi.org/10.1045/november14-murray-rust
6 Success: (200) OK http://doi.org/10.3897/bdj.2.e1125
7 Success: (200) OK http://doi.org/10.4033/iee.2013.6b.14.f
8 Success: (200) OK http://doi.org/10.1002/bult.2013.1720390406
9 Success: (200) OK http://doi.org/10.5061/dryad.h6pf365t
10 Success: (200) OK http://doi.org/10.1186/1756-0500-5-574
11 Success: (200) OK http://doi.org/10.1038/nature10266
12 Success: (200) OK http://doi.org/10.1038/npre.2011.6048
Return code 0
In particular, removing this warning would be nice:
Warning message:
In rm(vec) : object 'vec' not found
This was using R version 3.3.2 under Linux.
I've tried running this on my own ORCID,
$ git diff
diff --git a/checkmydois.R b/checkmydois.R
index c5ff9b6..bcf45c8 100644
--- a/checkmydois.R
+++ b/checkmydois.R
@@ -7,7 +7,7 @@ library(dplyr)
library(httr)
#Put your ORCID ID below
-your.ORCID.ID <- "0000-0002-3520-2046"
+your.ORCID.ID <- "0000-0001-9513-9993"
#This gets your list of works with identifiers from ORCID
#Thanks to Scott Chamberlain for this step https://github.com/ropensci/rorcid/issues/31
I know that many of these papers are paywalled, so perhaps this is not unexpected - but the error message is cryptic:
$ Rscript checkmydois.R ; echo "Return code $?"
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
[1] "http://doi.org/10.1111/mpp.12280"
... <snip> ...
Warning message:
In rm(vec) : object 'vec' not found
Error in curl::curl_fetch_memory(url, handle = handle) :
Failure when receiving data from the peer
Calls: http_status ... request_fetch -> request_fetch.write_memory -> <Anonymous> -> .Call
Execution halted
Return code 1
Currently the script has the ORCID ID hard coded. It would be great to have this as a command line option, or via an environment variable (perhaps defaulting to the current value for testing).
(I can see how this might then be used via a continuous integration service like TravisCI where the user can put in their own ORCID to the TravisCI settings, without having to modify the code in git)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.