Improvement : fetching new data to offline-data storage files (data/*.json)
rnm-patel opened this issue · 3 comments
rnm-patel commented
Improvement
Description
- I have seen that after requesting same "joke" for some times it is repeating, no matter with how many new jokes you fill into that data/joke.json file there's time when you may get repetative jokes if one goes recursive of jokes query...So the solution to it is as ....
- Fetching new data to offline-data storage files (data/*.json) to avoid repetitive response ...
Any ideas on how to implement it?
- after a certain number of requests, we fire one request in the background as separate thread to update the data for that file
- Example :
- suppose after a number of request to jokes == (20)
- fire a function to fetch new jokes via API from some jokes providing API service and update offline data storage file data/jokes.json with new 20 jokes and repeat the cycle...
rnm-patel commented
Tell me if anybody doing this ...
rnm-patel commented
After implementation of this, one need not require adding a new small number of quotes, facts or jokes as a separate pull request, as it increases burden to the maintainer
suryasr007 commented
Hi
Why can't we use jokes open API's such as chuck noris to fetch jokes?
For offline integration, we can store the fetched jokes.
If the idea seems good, I can work on it.