Comments (5)
An easy fix (tested on the example you provided) is to add a pause between two requests as follows:
taxonid <- c("11007", "3576", "7074", "4824", "5865",
"12290", "8816", "8876", "10073", "5276", "12244", "9253",
"30606", "10652", "10505", "7211", "6373", "65782", "11053", "6235" )
res <- list()
for (i in seq_along(taxonid)) {
res[[i]] <- spp_cites_legislation(taxon_id = taxonid[i], scope = "all", raw = TRUE)
Sys.sleep(1)
}
# using an unexported function
spp_legislation <- rcites:::rcites_combine_lists(res, taxonid, raw = TRUE)
I'm considering adding this feature in the package.
from rcites.
Thank you for reporting this, I also encounter an 4040 error when running the example, specifically I get:
R> spp_legislation <- spp_cites_legislation(taxon_id = taxonid, scope = "all"
, raw = TRUE)
→ Now processing taxon_id '11007'.....................✔
→ Now processing taxon_id '3576'......................✔
→ Now processing taxon_id '7074'......................✔
→ Now processing taxon_id '4824'......................✔
→ Now processing taxon_id '5865'......................✔
→ Now processing taxon_id '12290'.....................✔
→ Now processing taxon_id '8816'......................✔
→ Now processing taxon_id '8876'......................✔
→ Now processing taxon_id '10073'.....................✔
→ Now processing taxon_id '5276'......................✔
→ Now processing taxon_id '12244'.....................✔
→ Now processing taxon_id '9253'......................✔
→ Now processing taxon_id '30606'.....................✔
→ Now processing taxon_id '10652'.....................✔
→ Now processing taxon_id '10505'.....................✔
→ Now processing taxon_id '7211'......................✔
→ Now processing taxon_id '6373'......................✔
→ Now processing taxon_id '65782'.....................✔
→ Now processing taxon_id '11053'.....................Error in rcites_res(q_url, token, ...) : Not Found (HTTP 404).
(I've tried it 3 times and got the same results every time) I will try to investigate this issue latter today. In the meanwhile, looks like it's working when running one at a time.
from rcites.
It does not seem to be related with the code. Looks like the number of requests per IP has been lowered, my IP has just been banned, it never happened during the dev period were we did way more requests.
from rcites.
Thank you for this quick workaround! This indeed works.
from rcites.
I am closing this and opening a separate issue about the pause feature.
Thank you for the report.
from rcites.
Related Issues (20)
- Infinite recursion error when using non-interactively without token HOT 4
- Installation on covr failed in Travis HOT 1
- spp_cites_legislation() fails to return clean output for some taxa HOT 5
- pause feature for spp_*() functions HOT 1
- Website not deployed HOT 1
- Error in getting distribution data for species endemic to a single region HOT 3
- Change how classes are tested HOT 1
- Use GH actions instead of Travis HOT 1
- speed up tests with vcr
- test print methods properly HOT 2
- Precompute vignettes
- spp_*_legilation() sometime returns (apparently) unrelated info HOT 1
- console outputs and errors HOT 1
- Current issue on some GHA env for http request
- Report request status via `warn_for_status()` rather than `stop_for_status()` HOT 2
- Encode URLs HOT 3
- GHA setups keep failing on different environment HOT 3
- Synonyms info are not properly displayed
- pkgdown building failure HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcites.