-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding user agent to enter the polite pool #173
Comments
thanks for your question @poldham i assume this is being used in a shiny app? can you share the session info for the server it's running on? |
Thanks @sckott The session info is R version 3.5.1 (2018-07-02) Matrix products: default locale: attached base packages: other attached packages: loaded via a namespace (and not attached): |
Its possible that this is a polite pool issue, can you have them do cr_works(limit = 1, verbose = TRUE)
> GET /works?rows=1 HTTP/1.1
Host: api.crossref.org
Accept-Encoding: gzip, deflate
Accept: application/json, text/xml, application/xml, */*
User-Agent: r-curl/3.2 crul/0.6.0 rOpenSci(rcrossref/0.8.4.9100) (mailto:myrmecocystus@gmail.com)
X-USER-AGENT: r-curl/3.2 crul/0.6.0 rOpenSci(rcrossref/0.8.4.9100) (mailto:myrmecocystus@gmail.com) However, it may be that they aren't using the cursor for lots of results. Are they using the |
Many thanks @sckott I have a call with the India team in the morning so will check then. But, running that on my machine I get: GET /works?rows=1 HTTP/1.1 So the mailto element is not getting set. I'll just look at the docs again to cross check if I missed something on setting user agent. |
i think you can see the docs in |
Many thanks Scott, I had a feeling I was missing something. That was exactly the bit of the documentation I hadn't read! Tomorrow I will write a giant poster sized note to myself to read all the documentation first! Thanks so much for your time and I will let you know when we move the India biodiversity repository along. Cursor issue is noted as well but I'm sure the team was using cursor and will cross check. All the best, Paul |
Glad its sorted out. We should link to the docs on polite pool from the fxns, will add that |
Hi Scott and collaborators,
I have a question regarding how to add the user agent in the headers to a request. We have a team in India who are attempting to run a large query (for publications on India) that should pull back around 285,000 results. However, this is timing out and reading the documentation on the problem with degradation on the public API it may be because a user agent is not being specified to place the request in the polite pool https://github.com/CrossRef/rest-api-doc. With httr that would look like: GET("https://api.crossref.org/works?query.author=richard+feynman", user_agent("poldham")) but I've been struggling to get that working in the rcrossref funs with either httr or crul.
It may be I am missing something really obvious, but it also struck me that given the issues facing the public crossref API maybe in future updates rcrossref could include the user_agent as an arg and encourage users into the polite pool. So that could may be be a possible enhancement. Apologies in advance if I have missed something obvious! All the best, Paul
The text was updated successfully, but these errors were encountered: