In [1]:
library(jsonlite)
library(dplyr)
library(stringr)
library(httr)
# library(rjson)
library(tidyr)
library(psych)
library(reshape)
In [13]:
MyData <- read.csv(file="../data/clients.json", header=TRUE, sep=",")
head(MyData)
In [15]:
get_email <-function(id){
client<-fromJSON(paste0('https://api.datacite.org/clients/',id))
return(client$data$attributes$`contact-email`)
}
print(get_email("datacite.datacite"))
In [22]:
get_total <-function(id){
client<-fromJSON(paste0('https://api.datacite.org/dois?client-id=',id,'&page[size]=1'))
created<-client$meta$created
print(created)
return("lol")
}
print(get_total("dk.gbif"))
In [17]:
clients <- MyData %>% rowwise() %>% mutate(email=get_email(id))
In [20]:
file<-paste0("../data/",Sys.Date(),"_sclient_list.csv")
print(file)
write.csv(clients,file=file)
In [ ]: