swapagarwal/JARVIS-on-Messenger

Improvement : fetching new data to offline-data storage files (data/*.json)

rnm-patel opened this issue · 3 comments

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 :
  1. suppose after a number of request to jokes == (20)
  2. 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...

Tell me if anybody doing this ...

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

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.