rki-covid-api icon indicating copy to clipboard operation
rki-covid-api copied to clipboard

rValue history of germany

Open PatrickHaussmann opened this issue 3 years ago • 7 comments

this would fix #95

There are a few things i am not sure about:

  1. is the name /germany/history/rValue ok?
  2. the first 4 days have a r-value of null. Should we remove them?
  3. lastUpdate is set to now. Is there a better way get the lastUpdate value

PatrickHaussmann avatar May 03 '21 09:05 PatrickHaussmann

1. is the name `/germany/history/rValue` ok?

2. the first 4 days have a `r-value` of `null`. Should we remove them?

3. `lastUpdate` is set to `now`. Is there a better way get the `lastUpdate` value
  1. think thats okay
  2. yes, that makes sense.
  3. maybe as in vaccination.ts
const response = await axios.get(
    `https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile`,
    {
      responseType: "arraybuffer",
    }
  );
  const data = response.data;
  const lastModified = response.headers["last-modified"];
  const lastUpdate = lastModified != null ? new Date(lastModified) : new Date();

that should work .....

Rubber1Duck avatar May 03 '21 11:05 Rubber1Duck

if we would have: const lastUpdate = history[history.length - 1].date;

then it would be in line with what we return in the function getRValue. Alternatively, we could also get it from the headers in getRValue. what is your take on this?

PatrickHaussmann avatar May 03 '21 12:05 PatrickHaussmann

both should be the same and it is a good idea to take it from the header! My mind ....

Rubber1Duck avatar May 03 '21 13:05 Rubber1Duck

/germany/history/rValue/:days would be very nice!

Rubber1Duck avatar May 03 '21 13:05 Rubber1Duck

/germany/history/rValue/:days would be very nice!

I am already in the process :)

PatrickHaussmann avatar May 03 '21 13:05 PatrickHaussmann

i am very sorry that it is not clear to me. but what should i change/add in README.md?

PatrickHaussmann avatar May 03 '21 14:05 PatrickHaussmann

God job! for me that looks all fine!

Rubber1Duck avatar May 03 '21 14:05 Rubber1Duck

is replaced by new PR #494

Rubber1Duck avatar Dec 16 '22 22:12 Rubber1Duck